Marc Tanenbaum
5 年前
当前提交
36c63841
共有 12 个文件被更改,包括 268 次插入 和 55 次删除
-
41Assets/Objects/boats/Guns/Gun deploy timeline.playable
-
8Assets/Objects/boats/Guns.meta
-
14Assets/Objects/boats/Guns/BoatGunDeploySignal.signal
-
8Assets/Objects/boats/Guns/BoatGunDeploySignal.signal.meta
-
137Assets/Objects/boats/Guns/Gun particle material.mat
-
8Assets/Objects/boats/Guns/Gun particle material.mat.meta
-
52Assets/Objects/boats/Guns/GunController.cs
-
55Assets/GunController.cs
-
0/Assets/Objects/boats/Guns/Gun deploy timeline.playable
-
0/Assets/Objects/boats/Guns/Gun deploy timeline.playable.meta
-
0/Assets/Objects/boats/Guns/GunController.cs.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 45347ea33ba9f4dd2a57a5cfaae66ce3 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
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: d6fa2d92fc1b3f34da284357edf89c3b, type: 3} |
|||
m_Name: BoatGunDeploySignal |
|||
m_EditorClassIdentifier: |
|
|||
fileFormatVersion: 2 |
|||
guid: 8b91cd92bcc3142cb958b6399d31525d |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &-4451370308253676297 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 11 |
|||
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
version: 1 |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_Name: Splash |
|||
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3} |
|||
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _ALPHATEST_ON |
|||
m_LightmapFlags: 4 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: 3050 |
|||
stringTagMap: |
|||
RenderType: Transparent |
|||
disabledShaderPasses: |
|||
- ALWAYS |
|||
- SHADOWCASTER |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _BaseMap: |
|||
m_Texture: {fileID: 2800000, guid: 6b401b861e89e7848873e7851cd4d282, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BumpMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailAlbedoMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailMask: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailNormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 2800000, guid: 6b401b861e89e7848873e7851cd4d282, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MetallicGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _OcclusionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ParallaxMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- _AlphaClip: 1 |
|||
- _Blend: 1 |
|||
- _BlendOp: 0 |
|||
- _BumpScale: 1 |
|||
- _CameraFadingEnabled: 0 |
|||
- _CameraFarFadeDistance: 2 |
|||
- _CameraNearFadeDistance: 1 |
|||
- _ColorMode: 1 |
|||
- _Cull: 0 |
|||
- _Cutoff: 0.048 |
|||
- _DetailNormalMapScale: 1 |
|||
- _DistortionBlend: 0.5 |
|||
- _DistortionEnabled: 0 |
|||
- _DistortionStrength: 1 |
|||
- _DistortionStrengthScaled: 0.1 |
|||
- _DstBlend: 10 |
|||
- _EmissionEnabled: 0 |
|||
- _FlipbookBlending: 0 |
|||
- _FlipbookMode: 0 |
|||
- _GlossMapScale: 1 |
|||
- _Glossiness: 1 |
|||
- _GlossinessSource: 0 |
|||
- _GlossyReflections: 1 |
|||
- _InvFade: 3 |
|||
- _LightingEnabled: 1 |
|||
- _Metallic: 0 |
|||
- _Mode: 2 |
|||
- _OcclusionStrength: 1 |
|||
- _Parallax: 0.02 |
|||
- _QueueOffset: 0 |
|||
- _ReceiveShadows: 1 |
|||
- _Shininess: 1 |
|||
- _Smoothness: 0.183 |
|||
- _SmoothnessSource: 1 |
|||
- _SmoothnessTextureChannel: 0 |
|||
- _SoftParticlesEnabled: 1 |
|||
- _SoftParticlesFarFadeDistance: 0.1 |
|||
- _SoftParticlesNearFadeDistance: 0 |
|||
- _SpecSource: 0 |
|||
- _SpecularHighlights: 1 |
|||
- _SrcBlend: 1 |
|||
- _Surface: 1 |
|||
- _UVSec: 0 |
|||
- _WorkflowMode: 1 |
|||
- _ZWrite: 0 |
|||
m_Colors: |
|||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _BaseColorAddSubDiff: {r: 1, g: 0, b: 0, a: 0} |
|||
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} |
|||
- _Color: {r: 3.6368854, g: 3.6368854, b: 3.6368854, a: 1} |
|||
- _ColorAddSubDiff: {r: 1, g: 0, b: 0, a: 0} |
|||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _SoftParticleFadeParams: {r: 0, g: 10, b: 0, a: 0} |
|||
- _SpecColor: {r: 0.19998494, g: 0.19998494, b: 0.19998494, a: 0.2} |
|||
- _TintColor: {r: 1, g: 1, b: 1, a: 1} |
|
|||
fileFormatVersion: 2 |
|||
guid: 002f9fb3152ae47f2a6c0134a67cbfe4 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.InputSystem; |
|||
using UnityEngine.Playables; |
|||
|
|||
public class GunController : MonoBehaviour |
|||
{ |
|||
public InputAction fireAction; |
|||
public GameObject gun; |
|||
public ParticleSystem ps1; |
|||
public ParticleSystem ps2; |
|||
|
|||
private PlayableDirector gunDirector; |
|||
|
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
InitGuns(); |
|||
|
|||
// Have it run your code when the Action is triggered.
|
|||
fireAction.performed += DeployGuns; |
|||
|
|||
// Start listening for control changes.
|
|||
fireAction.Enable(); |
|||
} |
|||
|
|||
void InitGuns() |
|||
{ |
|||
gunDirector = gun.GetComponent<PlayableDirector>(); |
|||
gunDirector.time = 0f; |
|||
gunDirector.Stop(); |
|||
} |
|||
|
|||
void DeployGuns(InputAction.CallbackContext ctx) |
|||
{ |
|||
fireAction.performed -= DeployGuns; |
|||
gunDirector.Play(); |
|||
} |
|||
|
|||
public void GunsReady() |
|||
{ |
|||
fireAction.performed += FireGuns; |
|||
} |
|||
|
|||
void FireGuns(InputAction.CallbackContext ctx) |
|||
{ |
|||
Debug.Log("Fire guns!"); |
|||
ps1.Play(); |
|||
ps2.Play(); |
|||
} |
|||
} |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.InputSystem; |
|||
using UnityEngine.Playables; |
|||
|
|||
public class GunController : MonoBehaviour |
|||
{ |
|||
public InputAction fireAction; |
|||
|
|||
public GameObject gun; |
|||
|
|||
private PlayableDirector gunDirector; |
|||
|
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
InitGuns(); |
|||
|
|||
// Have it run your code when the Action is triggered.
|
|||
fireAction.performed += FireGuns; |
|||
|
|||
// Start listening for control changes.
|
|||
fireAction.Enable(); |
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update() |
|||
{ |
|||
// if (Input.GetAxis("fire") > 1)
|
|||
// {
|
|||
// DeployGuns();
|
|||
// }
|
|||
} |
|||
|
|||
void InitGuns() |
|||
{ |
|||
gunDirector = gun.GetComponent<PlayableDirector>(); |
|||
gunDirector.time = 0f; |
|||
gunDirector.Stop(); |
|||
|
|||
Debug.LogFormat("InitGuns {0}", gunDirector.time); |
|||
} |
|||
|
|||
void DeployGuns() |
|||
{ |
|||
gunDirector.Play(); |
|||
} |
|||
|
|||
void FireGuns(InputAction.CallbackContext ctx) |
|||
{ |
|||
Debug.Log("FIRE!!!!"); |
|||
gunDirector.Play(); |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue