// Use this for initialization public void Initialise() { //get all of the animations on the item List <BaseAnimation> animations = new List <BaseAnimation>(GetComponentsInParent <BaseAnimation>()); //get the size of the animations list int animationCount = animations.Count; //iterate through all animations, seperating them into two different lists depending on edge type for (int i = 0; i < animationCount; i++) { //store in a temp value BaseAnimation ba = animations[i]; //determine what type of edge type the animation has if (ba.edgeType == BaseAnimation.EdgeType.ENTRY) { entries.Add(ba); } else if (ba.edgeType == BaseAnimation.EdgeType.EXIT) { exits.Add(ba); } } }
/* * IsAnimating * * checks if there are still animations in the item running * * @returns bool - indicating if the item is still executing animations */ public bool IsAnimating() { //get all of the animations on the item List <BaseAnimation> animations = new List <BaseAnimation>(entries); animations.AddRange(exits); //get the size of the animations list int animationCount = animations.Count; //iterate through all animations, seperating them into two different lists depending on edge type for (int i = 0; i < animationCount; i++) { //store in a temp value BaseAnimation ba = animations[i]; //check if the timer has passed the maximum value for the animation if (ba.lerpValue < 1.0f) { return(true); } } return(false); }
public BaseButton(ButtonType buttonType = ButtonType.Empty, BaseAnimation clickAnimation = null) { this.ClickAnimation = (clickAnimation == null ? Game.Content.Animations.Press10 : clickAnimation); this.m_back = new FilledRect() { Alpha = Game.Content.Colors.ButtonBackAlpha }; this.m_back.SetColor(Game.Content.Colors.ButtonBack); switch (buttonType) { case ButtonType.MainMenuButton: { this.Width = Game.Content.GetSizeInDpi(200); this.Height = Game.Content.GetSizeInDpi(40); } break; case ButtonType.FieldButton: { this.Width = Game.Content.GetSizeInDpi(40); this.Height = Game.Content.GetSizeInDpi(40); } break; default: break; } }
// Use this for initialization void Start() { halo = GetComponent("Halo"); // hoverText = GameObject.FindGameObjectWithTag("EditorOnly").GetComponent <Text>(); hoverText.text = ""; snack = GameObject.Find("/Snack"); book = GameObject.Find("/Book"); anim = GameObject.Find("/Kid Container").GetComponent <BaseAnimation>(); }
// Use this for initialization void Start() { halo = GetComponent("Halo"); // hoverText = GameObject.FindGameObjectWithTag("EditorOnly").GetComponent <Text>(); hoverText.text = ""; makeSnack = GameObject.Find("/MakeSnack"); cake = GameObject.Find("/Cake"); car = GameObject.Find("/Car"); anim = GameObject.Find("/Kid Container").GetComponent <BaseAnimation>(); }
private void Reset() { BaseAnimation bA = gameObject.GetComponentInChildren <BaseAnimation>(); if (bA == null) { GameObject go = new GameObject(); go.transform.SetParent(transform); go.name = "BaseAnimation"; go.AddComponent <BaseAnimation>(); go.AddComponent <RectTransform>(); } }
public override void Execute() { if (animation != null) { GameObject animationGameObject = GameObject.Instantiate(animation); BaseAnimation animator = animationGameObject.GetComponent <BaseAnimation>(); animator.Setup(source, target, SetDone); animator.Run(); } else { SetDone(); } }
// Start is called before the first frame update void Start() { collider = GetComponent <BoxCollider>(); size = collider.size; player = GameObject.FindWithTag("Player"); mane = GameObject.Find("GameManeger").GetComponent <GameManeger>(); _stateClass = (MainStateClass)mane.NowManager; nav = GetComponent <NavMeshAgent>(); anim = GetComponent <Animator>(); destime = 0f; audio_ = GetComponent <AudioSource>(); particle = transform.GetChild(19).GetComponent <ParticleSystem>(); //EnemyClassを作成する AnimationClass = new BaseAnimation(); }
protected void AnimationFinished(Object sender, EventArgs e) { BaseAnimation finishedAnim = sender as BaseAnimation; foreach (MenuEvent ev in events.Values) { if (ev.EventType == MenuEvent.Type.AnimationFinished) { if (string.IsNullOrEmpty(ev.TriggerName) || ev.TriggerName == finishedAnim.Name) { eventsToTrigger.Add(ev); } } } }
protected virtual void Awake() { HPVAlues = this.GetComponentInChildren <HPBar>(); if (Owner.Group == Group.Player) { gameObject.AddComponent <ClickOn>(); gameObject.layer = LayerMask.NameToLayer("Clicklayer"); } else { gameObject.layer = LayerMask.NameToLayer("NPC"); } Owner.AddAgent(this); pointer = FindObjectOfType <Pointer>(); anims = GetComponent <BaseAnimation>(); AgentRigid = GetComponent <Rigidbody>(); SkinMeshRenderer = GetComponentInChildren <SkinnedMeshRenderer>(); }
internal static void SetBaseAnimation(BindableObject b, BaseAnimation value) => b.SetValue(BaseAnimationProperty, value);
private void Awake() { baseAnimation = gameObject.GetComponentInChildren <BaseAnimation>(); }
void OnEnable() { _target = target as BaseAnimation; }
public static void SetAnimation(BindableObject b, BaseAnimation value) => b.SetValue(AnimationProperty, value);
void Start() { AnimationClass = gameObject.GetComponent <PlayerAnimation>(); }
public TextButton(ButtonType buttonType = ButtonType.Empty, BaseAnimation clickAnimation = null) : base(buttonType, clickAnimation) { this.m_content = new TextSprite(Game.Content.Fonts.ButtonFont); this.m_content.SetColor(Game.Content.Colors.ButtonText); }
private void FineHandled(BaseAnimation anim) { var ranger = fineAnimations.FirstOrDefault(x => x.Value == anim).Key; fineAnimations.Remove(ranger); }
public void AddAnimation(BaseAnimation animation) { animations[animation.Name] = animation; animation.Finished += AnimationFinished; }
public override void ApplyAnimation(BaseAnimation animation, bool reverse = false, Action onComplete = null, Action onBegin = null) { animation.Apply(m_loadingSprite, reverse, onComplete, onBegin); }
public SpriteButton(ButtonType buttonType = ButtonType.Empty, BaseAnimation clickAnimation = null) : base(buttonType, clickAnimation) { this.m_content = new Sprite(); }
void AddModels() { if (leftPlayer != null) { Destroy(leftPlayer); } if (rightPlayer != null) { Destroy(rightPlayer); } enemyAnimation = null; Vector3 enRot = new Vector3(0.0f, 180.0f, 0.0f); if (rightUser.isMonster == true) { } else { if (rightUser.sex == User.SEX.MALE) { enemyAnimation = new MaleAnimation(); rightPlayer = Instantiate(objectHolder.male); AnimationHelper.SetPosition(rightPlayer, enemyAnimation.EStart()); AnimationHelper.SetRotation(rightPlayer, enRot); MaleConstants.Equip(rightPlayer, rightUser.items); } else { enemyAnimation = new MaleAnimation(); rightPlayer = Instantiate(objectHolder.female); AnimationHelper.SetPosition(rightPlayer, enemyAnimation.EStart()); AnimationHelper.SetRotation(rightPlayer, enRot); FemaleConstants.Equip(rightPlayer, rightUser.items); } } if (enemyAnimation == null) { Debug.Log("ERROR enemyAnimation == null"); enemyAnimation = new MaleAnimation(); } if (leftUser.sex == User.SEX.MALE) { leftPlayer = Instantiate(objectHolder.male); AnimationHelper.SetPosition(leftPlayer, enemyAnimation.Start()); MaleConstants.Equip(leftPlayer, leftUser.items); } else { leftPlayer = Instantiate(objectHolder.female); AnimationHelper.SetPosition(leftPlayer, enemyAnimation.Start()); FemaleConstants.Equip(leftPlayer, leftUser.items); } AnimationHelper.SetPosition(objectHolder.mainCamera.gameObject, enemyAnimation.CStart()); }
//アニメーションステートのセット public void SetAnimation(BaseAnimationState animation) { animation = this; }