HH
4 年前
当前提交
2387e68a
共有 14 个文件被更改,包括 1683 次插入 和 59 次删除
-
444Project/Assets/ML-Agents/Examples/Crawler/Prefabs/DynamicPlatform.prefab
-
2Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs
-
929Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
-
70Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeMovement.cs
-
1Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/FPSAgent.cs
-
87Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/GunController.cs
-
32Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/CinemachineFixedSignal.asset
-
8Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/CinemachineFixedSignal.asset.meta
-
73Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/MultiGunAlternating.cs
-
11Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/MultiGunAlternating.cs.meta
-
28Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ScreenshakeNoiseSettings.asset
-
8Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ScreenshakeNoiseSettings.asset.meta
-
38Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ShakeTransform.cs
-
11Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ShakeTransform.cs.meta
929
Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: a5969901aa40942499363f92e3787110, type: 3} |
|||
m_Name: CinemachineFixedSignal |
|||
m_EditorClassIdentifier: |
|||
m_XCurve: |
|||
serializedVersion: 2 |
|||
m_Curve: [] |
|||
m_PreInfinity: 2 |
|||
m_PostInfinity: 2 |
|||
m_RotationOrder: 4 |
|||
m_YCurve: |
|||
serializedVersion: 2 |
|||
m_Curve: [] |
|||
m_PreInfinity: 2 |
|||
m_PostInfinity: 2 |
|||
m_RotationOrder: 4 |
|||
m_ZCurve: |
|||
serializedVersion: 2 |
|||
m_Curve: [] |
|||
m_PreInfinity: 2 |
|||
m_PostInfinity: 2 |
|||
m_RotationOrder: 4 |
|
|||
fileFormatVersion: 2 |
|||
guid: 53fb1848ad6094b7c8e4456a51ecd694 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 11400000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class MultiGunAlternating : MonoBehaviour |
|||
{ |
|||
|
|||
public KeyCode shootKey = KeyCode.J; |
|||
|
|||
[Header("AUTOSHOOT")] public bool autoShootEnabled; |
|||
|
|||
[Header("GUNS")] public List<GunController> gunList = new List<GunController>(); |
|||
public int currentGunIndex; |
|||
|
|||
[Header("TIMING")] |
|||
public float shootingRate = .02f; //can shoot every shootingRate seconds. ex: .5 can shoot every .5 seconds
|
|||
private float shootTimer; |
|||
public bool coolDownComplete; |
|||
|
|||
public |
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
|
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update() |
|||
{ |
|||
|
|||
// if(shoot)
|
|||
// while (Input.GetKey(shootKey))
|
|||
// {
|
|||
//// Shoot();
|
|||
// ShootQuantity(1);
|
|||
// }
|
|||
// if (Input.GetKeyDown(shootKey))
|
|||
// {
|
|||
//// Shoot();
|
|||
// ShootQuantity(1);
|
|||
// }
|
|||
} |
|||
|
|||
void ShootGunAtIndex(int i) |
|||
{ |
|||
currentGunIndex = i >= gunList.Count - 1 ? 0 : i + 1; |
|||
gunList[currentGunIndex].Shoot(); |
|||
shootTimer = 0; |
|||
} |
|||
|
|||
void FixedUpdate() |
|||
{ |
|||
coolDownComplete = shootTimer > shootingRate; |
|||
if (coolDownComplete) |
|||
{ |
|||
if (autoShootEnabled) |
|||
{ |
|||
ShootGunAtIndex(currentGunIndex); |
|||
} |
|||
if (Input.GetKey(shootKey)) |
|||
{ |
|||
ShootGunAtIndex(currentGunIndex); |
|||
} |
|||
} |
|||
shootTimer += Time.fixedDeltaTime; |
|||
} |
|||
|
|||
|
|||
// IEnumerator HandleShooting()
|
|||
// {
|
|||
// WaitForFixedUpdate wait = new WaitForFixedUpdate();
|
|||
// }
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0759b2416b6374748b3c4bc904d0bdb7 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: b7f59e54f2bfd184b9dd451a678d089b, type: 3} |
|||
m_Name: ScreenshakeNoiseSettings |
|||
m_EditorClassIdentifier: |
|||
PositionNoise: |
|||
- X: |
|||
Frequency: 5 |
|||
Amplitude: 2 |
|||
Constant: 0 |
|||
Y: |
|||
Frequency: 5 |
|||
Amplitude: 0 |
|||
Constant: 0 |
|||
Z: |
|||
Frequency: 3 |
|||
Amplitude: 2 |
|||
Constant: 0 |
|||
OrientationNoise: [] |
|
|||
fileFormatVersion: 2 |
|||
guid: b2eabee1c7e4343a39540f00ded82863 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 11400000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
//using System.Collections;
|
|||
//using System.Collections.Generic;
|
|||
//using UnityEngine;
|
|||
//
|
|||
//public class ShakeTransform : MonoBehaviour
|
|||
//{
|
|||
// [Header("TIMING")] public float duration;
|
|||
// public float amount = .1f;
|
|||
//
|
|||
//// //if not
|
|||
//// public Transform rootTransform;
|
|||
// private Vector3 startPos;
|
|||
// // Start is called before the first frame update
|
|||
// void Start()
|
|||
// {
|
|||
//
|
|||
// }
|
|||
//
|
|||
// // Update is called once per frame
|
|||
// void Update()
|
|||
// {
|
|||
//
|
|||
// }
|
|||
//
|
|||
//
|
|||
// IEnumerator HandleShooting()
|
|||
// {
|
|||
// WaitForFixedUpdate wait = new WaitForFixedUpdate();
|
|||
// var timer = 0;
|
|||
// startPos = transform.localPosition;
|
|||
// while (timer < duration)
|
|||
// {
|
|||
// var pos = startPos + (Random.insideUnitSphere * amount);
|
|||
// transform.localPosition = pos;
|
|||
// yield return wait;
|
|||
// }
|
|||
// }
|
|||
//}
|
|
|||
fileFormatVersion: 2 |
|||
guid: 9e0e79489d4bb480895712096a4d97ec |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue