浏览代码

Added gun particles

/2019.3-marc
Marc Tanenbaum 5 年前
当前提交
36c63841
共有 12 个文件被更改,包括 268 次插入55 次删除
  1. 41
      Assets/Objects/boats/Guns/Gun deploy timeline.playable
  2. 8
      Assets/Objects/boats/Guns.meta
  3. 14
      Assets/Objects/boats/Guns/BoatGunDeploySignal.signal
  4. 8
      Assets/Objects/boats/Guns/BoatGunDeploySignal.signal.meta
  5. 137
      Assets/Objects/boats/Guns/Gun particle material.mat
  6. 8
      Assets/Objects/boats/Guns/Gun particle material.mat.meta
  7. 52
      Assets/Objects/boats/Guns/GunController.cs
  8. 55
      Assets/GunController.cs
  9. 0
      /Assets/Objects/boats/Guns/Gun deploy timeline.playable
  10. 0
      /Assets/Objects/boats/Guns/Gun deploy timeline.playable.meta
  11. 0
      /Assets/Objects/boats/Guns/GunController.cs.meta

41
Assets/Objects/boats/Guns/Gun deploy timeline.playable


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8071487651172747717
MonoBehaviour:
m_ObjectHideFlags: 1
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: 15c38f6fa1940124db1ab7f6fe7268d1, type: 3}
m_Name: Signal Emitter
m_EditorClassIdentifier:
m_Time: 0.8
m_Retroactive: 0
m_EmitOnce: 1
m_Asset: {fileID: 11400000, guid: 8b91cd92bcc3142cb958b6399d31525d, type: 2}
--- !u!114 &-6049370162252974172
MonoBehaviour:
m_ObjectHideFlags: 1

m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0
m_Events: []
--- !u!114 &-746715573979496274
MonoBehaviour:
m_ObjectHideFlags: 1
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: b46e36075dd1c124a8422c228e75e1fb, type: 3}
m_Name: Signal Track
m_EditorClassIdentifier:
m_Version: 3
m_AnimClip: {fileID: 0}
m_Locked: 0
m_Muted: 0
m_CustomPlayableFullTypename:
m_Curves: {fileID: 0}
m_Parent: {fileID: 11400000}
m_Children: []
m_Clips: []
m_Markers:
m_Objects:
- {fileID: -8071487651172747717}
--- !u!114 &-180195586536065447
MonoBehaviour:
m_ObjectHideFlags: 1

m_EditorClassIdentifier:
m_Version: 0
m_Tracks:
- {fileID: -746715573979496274}
- {fileID: -2685215770955292696}
- {fileID: -6049370162252974172}
- {fileID: -180195586536065447}

8
Assets/Objects/boats/Guns.meta


fileFormatVersion: 2
guid: 45347ea33ba9f4dd2a57a5cfaae66ce3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

14
Assets/Objects/boats/Guns/BoatGunDeploySignal.signal


%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:

8
Assets/Objects/boats/Guns/BoatGunDeploySignal.signal.meta


fileFormatVersion: 2
guid: 8b91cd92bcc3142cb958b6399d31525d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

137
Assets/Objects/boats/Guns/Gun particle material.mat


%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}

8
Assets/Objects/boats/Guns/Gun particle material.mat.meta


fileFormatVersion: 2
guid: 002f9fb3152ae47f2a6c0134a67cbfe4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

52
Assets/Objects/boats/Guns/GunController.cs


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();
}
}

55
Assets/GunController.cs


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();
}
}

/Assets/Objects/boats/Gun deploy timeline.playable → /Assets/Objects/boats/Guns/Gun deploy timeline.playable

/Assets/Objects/boats/Gun deploy timeline.playable.meta → /Assets/Objects/boats/Guns/Gun deploy timeline.playable.meta

/Assets/GunController.cs.meta → /Assets/Objects/boats/Guns/GunController.cs.meta

正在加载...
取消
保存