コード例 #1
0
    // 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);
            }
        }
    }
コード例 #2
0
    /*
     * 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);
    }
コード例 #3
0
ファイル: BaseButton.cs プロジェクト: uu3474/networkgame
        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;
            }
        }
コード例 #4
0
 // 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>();
 }
コード例 #5
0
 // 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>();
 }
コード例 #6
0
    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>();
        }
    }
コード例 #7
0
 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();
     }
 }
コード例 #8
0
 // 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();
 }
コード例 #9
0
ファイル: LogicalNode.cs プロジェクト: AlexMacocian/MonoMenu
        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);
                    }
                }
            }
        }
コード例 #10
0
 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>();
 }
コード例 #11
0
 internal static void SetBaseAnimation(BindableObject b, BaseAnimation value) => b.SetValue(BaseAnimationProperty, value);
コード例 #12
0
 private void Awake()
 {
     baseAnimation = gameObject.GetComponentInChildren <BaseAnimation>();
 }
コード例 #13
0
 void OnEnable()
 {
     _target = target as BaseAnimation;
 }
コード例 #14
0
 public static void SetAnimation(BindableObject b, BaseAnimation value) => b.SetValue(AnimationProperty, value);
コード例 #15
0
 void Start()
 {
     AnimationClass = gameObject.GetComponent <PlayerAnimation>();
 }
コード例 #16
0
ファイル: TextButton.cs プロジェクト: uu3474/networkgame
 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);
 }
コード例 #17
0
ファイル: RangerLayer.cs プロジェクト: mrc-glk/gsec
        private void FineHandled(BaseAnimation anim)
        {
            var ranger = fineAnimations.FirstOrDefault(x => x.Value == anim).Key;

            fineAnimations.Remove(ranger);
        }
コード例 #18
0
ファイル: LogicalNode.cs プロジェクト: AlexMacocian/MonoMenu
 public void AddAnimation(BaseAnimation animation)
 {
     animations[animation.Name] = animation;
     animation.Finished        += AnimationFinished;
 }
コード例 #19
0
ファイル: LoadingScreen.cs プロジェクト: uu3474/networkgame
 public override void ApplyAnimation(BaseAnimation animation, bool reverse = false, Action onComplete = null, Action onBegin = null)
 {
     animation.Apply(m_loadingSprite, reverse, onComplete, onBegin);
 }
コード例 #20
0
ファイル: SpriteButton.cs プロジェクト: uu3474/networkgame
 public SpriteButton(ButtonType buttonType = ButtonType.Empty, BaseAnimation clickAnimation = null)
     : base(buttonType, clickAnimation)
 {
     this.m_content = new Sprite();
 }
コード例 #21
0
ファイル: Logic.cs プロジェクト: jhenyagavrilenko/greek
    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());
    }
コード例 #22
0
 //アニメーションステートのセット
 public void SetAnimation(BaseAnimationState animation)
 {
     animation = this;
 }