Добавить движущегося противника, который при обнаружении персонажа
должен стрелять в него. ( типа стреляет)
This commit is contained in:
1 parent
7a155dfb5e
commit
e5da7ed93f
143 files changed
+15687
-11
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace namespace_animclip_offset{
|
||||
public class anim_clip_offset : MonoBehaviour
|
||||
{
|
||||
private Animator animator;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
Play_Animationclip_offset();
|
||||
}
|
||||
|
||||
void Play_Animationclip_offset()
|
||||
{
|
||||
AnimatorClipInfo[] clip_name = animator.GetCurrentAnimatorClipInfo(0);
|
||||
AnimationClip anim_clip = clip_name[0].clip;
|
||||
|
||||
float time = Random.Range(0f, anim_clip.length);
|
||||
int clip_position = animator.GetCurrentAnimatorStateInfo(0).shortNameHash;
|
||||
|
||||
animator.Play(clip_position, 0, time / anim_clip.length);
|
||||
|
||||
|
||||
}
|
||||
void Update(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3669bdc2ff810741a270a5dfea73794
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 362212
|
||||
packageName: Dark Big Ghosts LITE
|
||||
packageVersion: 1.0
|
||||
assetPath: Assets/Dark Big Ghosts LITE/Scripts/anim_clip_offset.cs
|
||||
uploadId: 863984
|
||||
Reference in new issue
Block a user