Inheritance: MonoBehaviour
Example #1
0
 private void Awake()
 {
     characterController = GetComponent <CharacterController>();
     animationHandler    = GetComponent <AnimationHandler>();
     flame1.SetActive(false);
     flame2.SetActive(false);
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     hs = Camera.main.GetComponent<HarlemShake> ();
     thePlayer = GameObject.FindGameObjectWithTag ("Player");
     ah = thePlayer.GetComponent<AnimationHandler> ();
     aet = thePlayer.GetComponent<AudioEngineThing> ();
 }
 private void OnDamaged()
 {
     QuickLogger.Debug("OnDamaged", true);
     AnimationHandler.SetBoolHash(BitDamageState, true);
     AnimationHandler.SetIntHash(ShaftStateHash, 2);
     UpdateSystemLights(PowerManager.GetPowerState());
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     hs = Camera.main.GetComponent<HarlemShake> ();
     thePlayer = GameObject.FindGameObjectWithTag ("Player");
     ah = thePlayer.GetComponent<AnimationHandler> ();
     playerHealthSystem = thePlayer.GetComponent<HealthSystem> ();
 }
Example #5
0
 void Awake()
 {
     if (!Instance)
     {
         Instance = this;
     }
 }
    public void ShowPerfectNotification()
    {
        AnimationHandler.PlayShakeAnim(m_gameplayViewRefs.m_perfectImage.transform);

        DOTween.Sequence().Append(m_gameplayViewRefs.m_perfectImage.DOFade(1, 0.2f).SetEase(Ease.Linear))
        .Insert(1.3f, m_gameplayViewRefs.m_perfectImage.DOFade(0, 0.2f).SetEase(Ease.Linear));
    }
Example #7
0
 // Start is called before the first frame update
 void Start()
 {
     AnimHandler  = transform.GetComponentInParent <AnimationHandler>();
     redFinished  = true;
     blueFinished = true;
     RedOn        = false;
 }
 void Start()
 {
     animations        = GetComponent <AnimationHandler>();
     questionGenerator = GetComponent <QuestionGenerator>();
     profile           = GameObject.Find("ProfileData").GetComponent <Profile>();
     audioScript       = GameObject.Find("AudioManager").GetComponent <PlayAudio>();
 }
Example #9
0
    public void Setup()
    {
        if (isSetup)
        {
            return;
        }

        isSetup = true;

        friendPool     = new ViewPool <ExploreFriendsView>(friendsView, 0);
        friendViewById = new Dictionary <string, ExploreFriendsView>();

        crowdHandler = new CrowdHandler();
        crowdHandler.onInfoUpdate += OnCrowdInfoUpdated;

        mapInfoHandler = new MapInfoHandler();
        mapInfoHandler.onInfoUpdate += OnMapInfoUpdated;

        friendsHandler = new FriendsHandler(mapInfoHandler);
        friendsHandler.onFriendAdded   += OnFriendAdded;
        friendsHandler.onFriendRemoved += OnFriendRemoved;

        thumbnailHandler = new ThumbnailHandler();
        animationHandler = new AnimationHandler(viewAnimator);
    }
    private void Awake() {
        animHandle = GetComponent<AnimationHandler>();
        state = 0;

        if (SceneManager.GetActiveScene().name == "Train")
        {
            isTrain = true;
        }
        else
        {
            isTrain = false;
        }

        if (isTrain)
        {
            transform.position = new Vector3(Random.Range(-3.5f, 5.6f), Random.Range(-3.2f, 3.2f), -1.0f);

        }
        else
        {
            transform.position = new Vector3(Random.Range(-5.6f, 5.6f), Random.Range(-3.2f, 3.2f), -1.0f);

        }
        changeTarget();
    }
Example #11
0
        public Player(String sN, GraphicsDeviceManager graphics)
        {
            if (sN.Equals("Naruto") || sN.Equals("naruto"))
            {
                name = sN;
                Run  = new AnimationHandler(new Rectangle[] { new Rectangle(1, 0, 49, 59), new Rectangle(57, 0, 63, 59), new Rectangle(132, 0, 55, 59),
                                                              new Rectangle(196, 0, 45, 59), new Rectangle(247, 0, 60, 59), new Rectangle(318, 0, 56, 59) });

                Walk = new AnimationHandler(new Rectangle[] { new Rectangle(4, 0, 26, 71), new Rectangle(39, 0, 43, 71), new Rectangle(93, 0, 42, 71),
                                                              new Rectangle(144, 0, 31, 71), new Rectangle(183, 0, 40, 71), new Rectangle(233, 0, 36, 71) });

                Crouch = new AnimationHandler(new Rectangle[] { new Rectangle(0, 0, 36, 65), new Rectangle(50, 0, 35, 65), new Rectangle(98, 0, 34, 65) });

                Special = new AnimationHandler(new Rectangle[] { new Rectangle(2, 0, 79, 94), new Rectangle(90, 0, 105, 94), new Rectangle(206, 0, 90, 94), new Rectangle(305, 0, 113, 94),
                                                                 new Rectangle(427, 0, 132, 94), new Rectangle(574, 0, 155, 94) });

                Attack = new ComboHandler("BasicCombo", new AnimationHandler[] { new AnimationHandler(new Rectangle[] { new Rectangle(0, 0, 48, 66), new Rectangle(49, 0, 56, 66), new Rectangle(107, 0, 75, 66),
                                                                                                                        new Rectangle(185, 0, 61, 66) }),
                                                                                 new AnimationHandler(new Rectangle[] { new Rectangle(7, 0, 51, 60), new Rectangle(66, 0, 58, 60), new Rectangle(133, 0, 59, 60),
                                                                                                                        new Rectangle(199, 0, 63, 60) }),
                                                                                 new AnimationHandler(new Rectangle[] { new Rectangle(3, 0, 46, 66), new Rectangle(59, 0, 60, 66), new Rectangle(126, 0, 63, 66),
                                                                                                                        new Rectangle(198, 0, 54, 66) }) });

                Stance = new AnimationHandler(new Rectangle[] { new Rectangle(0, 0, 56, 64) });

                Location        = new Vector2(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight - 80);
                SpecialAttTimer = -11;
            }
        }
Example #12
0
    public AnimationHandler AnimateScale(Vector3 newScale, float duration, Tweener.InterpolationType interpolationType = Tweener.InterpolationType.LINEAR)
    {
        AnimationHandler animationHandler = new AnimationHandler();
        Vector3          currentScale     = transform.localScale;

        if (Mathf.Abs(currentScale.x - newScale.x) > Tweener.MinTargetDifference)
        {
            tweeners.Add(new ScaleTweener(this.gameObject, duration, Tweener.TweenerType.X, newScale.x, interpolationType));
            animationHandler.AddTweener(tweeners [tweeners.Count - 1]);
        }

        if (Mathf.Abs(currentScale.y - newScale.y) > Tweener.MinTargetDifference)
        {
            tweeners.Add(new ScaleTweener(this.gameObject, duration, Tweener.TweenerType.Y, newScale.y, interpolationType));
            animationHandler.AddTweener(tweeners [tweeners.Count - 1]);
        }

        if (Mathf.Abs(currentScale.z - newScale.z) > Tweener.MinTargetDifference)
        {
            tweeners.Add(new ScaleTweener(this.gameObject, duration, Tweener.TweenerType.Z, newScale.z, interpolationType));
            animationHandler.AddTweener(tweeners [tweeners.Count - 1]);
        }

        return(animationHandler);
    }
Example #13
0
 // Use this for initialization
 void Start()
 {
     //把当前的AnimationClip x assign 给AnimationManager这个全局对象instance
     instance         = this;
     animationHandler = PlayRun;
     animation        = GetComponent <Animation>();
 }
Example #14
0
    public AnimationHandler AnimatePosition(Vector3 newPos, float duration, bool local = false, Tweener.InterpolationType interpolationType = Tweener.InterpolationType.LINEAR,
                                            Tweener.TweenerEventHandler onFinished     = null, float delay = 0f)
    {
        AnimationHandler animationHandler = new AnimationHandler();
        Vector3          currentPos       = transform.position;

        if (local)
        {
            currentPos = transform.localPosition;
        }

        if (Mathf.Abs(currentPos.x - newPos.x) > Tweener.MinTargetDifference)
        {
            tweeners.Add(new PositionTweener(this.gameObject, duration, Tweener.TweenerType.X, newPos.x, interpolationType, local, onFinished, delay));
            animationHandler.AddTweener(tweeners [tweeners.Count - 1]);
            onFinished = null;
        }

        if (Mathf.Abs(currentPos.y - newPos.y) > Tweener.MinTargetDifference)
        {
            tweeners.Add(new PositionTweener(this.gameObject, duration, Tweener.TweenerType.Y, newPos.y, interpolationType, local, onFinished, delay));
            animationHandler.AddTweener(tweeners [tweeners.Count - 1]);
            onFinished = null;
        }

        if (Mathf.Abs(currentPos.z - newPos.z) > Tweener.MinTargetDifference)
        {
            tweeners.Add(new PositionTweener(this.gameObject, duration, Tweener.TweenerType.Z, newPos.z, interpolationType, local, onFinished, delay));
            animationHandler.AddTweener(tweeners [tweeners.Count - 1]);
            onFinished = null;
        }

        return(animationHandler);
    }
 protected EnemyStateMachine(int frameRate)
 {
     currState = 0;
     animHandler = new AnimationHandler(Initialize());
     animHandler.frameRate = frameRate;
     Initialize();
 }
Example #16
0
    public AnimationHandler AnimateRotation(Vector3 newEulerRotation, float duration,
                                            bool local = false, Tweener.InterpolationType interpolationType = Tweener.InterpolationType.LINEAR)
    {
        AnimationHandler animationHandler = new AnimationHandler();
        Vector3          currentRotation  = transform.eulerAngles;

        if (local)
        {
            currentRotation = transform.localEulerAngles;
        }

        if (Mathf.Abs(currentRotation.x - newEulerRotation.x) > Tweener.MinTargetDifference)
        {
            tweeners.Add(new RotationTweener(this.gameObject, duration, Tweener.TweenerType.X, newEulerRotation.x, interpolationType, local));
            animationHandler.AddTweener(tweeners [tweeners.Count - 1]);
        }

        if (Mathf.Abs(currentRotation.y - newEulerRotation.y) > Tweener.MinTargetDifference)
        {
            tweeners.Add(new RotationTweener(this.gameObject, duration, Tweener.TweenerType.Y, newEulerRotation.y, interpolationType, local));
            animationHandler.AddTweener(tweeners [tweeners.Count - 1]);
        }

        if (Mathf.Abs(currentRotation.z - newEulerRotation.z) > Tweener.MinTargetDifference)
        {
            tweeners.Add(new RotationTweener(this.gameObject, duration, Tweener.TweenerType.Z, newEulerRotation.z, interpolationType, local));
            animationHandler.AddTweener(tweeners [tweeners.Count - 1]);
        }

        return(animationHandler);
    }
Example #17
0
 public Torch(Scene scene, Vector2 position, int id)
 {
     this.id          = id;
     this.scene       = scene;
     this.position    = position;
     animationHandler = new AnimationHandler(scene.game, scene.game.textureHandler.torch, 3, null);
 }
Example #18
0
        public override void Render()
        {
            Terminal.Clear();
            StateHandler.Draw();
            AnimationHandler.Draw(_mapLayer);

            bool inMission = StateHandler.Peek().Match(
                some: state => !(state is MenuState) && !(state is IntermissionFrameState),
                none: () => false);

            if (inMission)
            {
                InfoPanel.Draw(_infoLayer);
                RadarPanel.Draw(_radarLayer);
                ObjectivePanel.Draw(_objectiveLayer);
                MessagePanel.Draw(_messageLayer);

                foreach (KeyValuePair <ISchedulable, int> kvp in EventScheduler._schedule)
                {
                    if (kvp.Key is DelayAttack da)
                    {
                        da.Draw(_mapLayer);
                    }
                }
            }

            Terminal.Refresh();
        }
    public bool inflict = false;    //Viene usato per evitare che togla vita ad ogni collider dei  nemici, usato su SwordScript



    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
    }
Example #20
0
    // Start is called before the first frame update
    void Start()
    {
        animationHandler = GetComponent <AnimationHandler>();
        playerManager    = PlayerManager.GetInstance();

        InputManager.INPUT_ACTION += ReceiveInput;
    }
        public async void executeAnimations()
        {
            if (ComboBox.SelectedItem == null)
            {
                return;
            }
            switch (ComboBox.SelectedIndex)
            {
            case 1:
                AnimationHandler.ExecuteAnimation(new AllRandomAnimation(connector), lights);
                break;

            case 2:
                AnimationHandler.ExecuteAnimation(new BlackWhiteAnimation(connector), lights);
                break;

            case 3:
                AnimationHandler.ExecuteAnimation(new RandomAnimation(connector), lights);
                break;

            case 4:
                AnimationHandler.ExecuteAnimation(new ColorLoop((int)HueSlider.Value, lights.Count, connector), lights);
                break;

            case 5:
                AnimationHandler.ExecuteAnimation(new ColorLoopBack((int)HueSlider.Value, lights.Count, connector), lights);
                break;
            }
        }
Example #22
0
 private void Awake()
 {
     Animator         = GetComponent <Animator>();
     AnimationHandler = GetComponent <AnimationHandler>();
     BoxCollider2D    = GetComponent <BoxCollider2D>();
     GetComponent <EnemyHandler>().Enemy = this;
 }
Example #23
0
        public override void LoadContent()
        {
            Body = CurrentWorld.AddBody(this, InitPosition, Size);
            Body.ChildHitboxes[Key + "_body"] = new Hitbox(this, new Vector2(0, 0), Size, Key + "_body")
            {
                DebugSprite = Debug.Assets.BlueBox,
                Data        = new CollisionPackage()
                {
                    Value = Key
                }
            };

            AnimationHandler = new AnimationHandler(this)
            {
                LayerDepth = 1f,
            };
            AnimationHandler.SetShaderEffect(new PanelLines());
            _animationLibrary = new Player_AnimationLibrary();
            _animationLibrary.LoadAnimations(AnimationHandler);

            _controller         = Game.GlobalKeyboard;
            _controller.History = new InputRecord(_controller);
            _controller.History.InitKBRecord();

            State           = new Player_State();
            _behaviorScript = new Player_BehaviorScript(this);
            _behaviorScript.SetController(ref _controller);
            _behaviorScript.InitBehaviors();

            AnimationHandler.ChangeAnimation((int)AnimationStates.Idle);
            AnimationHandler.Facing = Orientation.Right;
        }
Example #24
0
 public void PlayJumpUp()
 {
     animation.Play(JumpUp.name);
     if (animation[JumpUp.name].normalizedTime > 0.95f)
     {
         animationHandler = PlayRun;
     }
 }
Example #25
0
 void Start()
 {
     player             = GetComponent <Player> ();
     animator           = FindObjectOfType <AnimationHandler>();
     curentState        = PlayerState.Normal;
     interactionHandler = FindObjectOfType <InteractionHandler>();
     playerController   = GetComponent <Controller2D>();
 }
Example #26
0
 public void PlayRoll()
 {
     animation.Play(Roll.name);
     if (animation[Roll.name].normalizedTime > 0.95f)
     {
         animationHandler = PlayRun;
     }
 }
Example #27
0
 public PlayerMovementHandler(Player player, List <Component> components, AnimationHandler animationHandler, PlayerAttributes playerAttributes, MainGame game)
 {
     this.player           = player;
     this.components       = components;
     this.animationHandler = animationHandler;
     this.playerAttributes = playerAttributes;
     this.game             = game;
 }
Example #28
0
        private void Start()
        {
            unit        = GetComponent <Unit>();
            animator    = GetComponent <Animator>();
            animHandler = unit.animationHandler;

            unit.onTimedDefense += SetupCounterAttack;
        }
Example #29
0
 public void PlayDoubleJump()
 {
     animation.Play(Roll.name);
     if (animation[Roll.name].normalizedTime > 0.95f)
     {
         animationHandler = PlayJumpLoop;
     }
 }
Example #30
0
        public static void NewMission(MissionInfo info)
        {
            MessagePanel.Clear();
            AnimationHandler.Clear();

            SetupLevel(info);
            StateHandler.PushState(NormalState.Instance);
        }
Example #31
0
 public Bullet(Scene scene, Vector2 position, Vector2 velocity, Texture2D texture)
 {
     this.position    = position;
     this.velocity    = velocity;
     this.texture     = texture;
     collisionHandler = new CollisionHandler(scene);
     animationHandler = new AnimationHandler(scene.game, texture, 0, new Vector2(texture.Width / 2, texture.Height / 2));
 }
Example #32
0
 public void PlayTurnRight()
 {
     animation.Play(TurnRight.name);
     if (animation[TurnRight.name].normalizedTime > 0.95f)
     {
         animationHandler = PlayRun;
     }
 }
Example #33
0
 void Awake()
 {
     GameLogic.PlayerList.Add(this);
     Animator = new AnimationHandler(this);
     this.ID  = GameLogic.GetLastID();
     //this.Spellbook = Skills.GetAllActiveSkillsByClass(this, this.@class);
     CombatLogger = new CombatLogger(this);
 }
 public PlayerStateMachine(float frameRate)
 {
     currState = State.Idle;
     animHandler = new AnimationHandler(15, 6, 7, 7, 13, 9, 3, 9, 1, 4, 4, 1);
     animHandler.frameRate = frameRate;
     getNextState = new machine[] { Idle,
     Attacking, MovingAttack, InAirAttack, Move,
     Dashing, Jumping, InAirNow, OnWall, WallJump, Hit, Dead };
 }
Example #35
0
        public void Initialize(GameContext context)
        {
            Texture = context.Content.Load<Texture2D>("Scenes/Levels/ChallengeCompleted");
            HalfSize = new Vector2(Texture.Width / 2f, Texture.Height / 2f);

            animationHandler = new AnimationHandler<int>();
            animationHandler.Animations.Add(0, new Animation(0, 1, TimeSpan.FromSeconds(2.5)));

            Position = new Vector2((int)(Device.HalfWidth - HalfSize.X), -Texture.Height);
            target = Position;
        }
Example #36
0
    // Use this for initialization
    void Start()
    {
        GameObject _p = GameObject.Find("Player");
        if (_p != null)
        {
            player = _p;

            playerHandler = player.GetComponent<PlayerHandler>();
        }

        animationHandler = this.GetComponent<AnimationHandler>();
    }
Example #37
0
    // Use this for initialization
    void Start()
    {
        int currentXp = 0;
        int xpToIncrease = 50;

        for (int i = 0; i < 20; i++)
        {
            currentXp += xpToIncrease;
            levelList.Add(currentXp);
            xpToIncrease = (int)(xpToIncrease * 1.25);
        }

        playerHandler = this.GetComponent<PlayerHandler>();
        animationHandler = this.GetComponent<AnimationHandler>();
    }
Example #38
0
 // Use this for initialization
 void Start()
 {
     state = State.Idle;
     camera = GameObject.FindGameObjectWithTag("MainCamera");
     animHandler = GetComponent<AnimationHandler>();
 }
Example #39
0
    // Use this for initialization
    void Start()
    {
        camera = GameObject.FindGameObjectWithTag("MainCamera");
        animHandler = GetComponent<AnimationHandler>();
        coyote = GameObject.FindWithTag("coyote").GetComponent<Coyote>();

        state = State.Moving;
    }
Example #40
0
    // Use this for initialization
    void Start()
    {
        animHandler = GetComponent<AnimationHandler>();
        kid = GameObject.FindWithTag("kid").GetComponent<Kid>();
        camera = GameObject.FindGameObjectWithTag("MainCamera");

        if (comeFromRight)
        {
            var renderer = GetComponentInChildren<MeshRenderer>();
            renderer.enabled = false;

            state = State.WaitingToSpawn;
        }
        else
        {
            state = State.Idle;
        }
    }
Example #41
0
 void Awake()
 {
     handler = AnimationHandler.Instance;
 }
Example #42
0
    // Use this for initialization
    void Start()
    {
        startPosition = transform.position;
        nextTurnPoint = transform.position;
        attacking = false;
        returningToSpawnPoint = false;
        currentSpeed = fishSpeed;
        thePlayer = GameObject.FindGameObjectWithTag ("Player");
        healthSystem = GetComponent<HealthSystem> ();
        playerAnimation = thePlayer.GetComponent<AnimationHandler> ();

        randomDirection ();
    }
Example #43
0
 // Use this for initialization
 void Start()
 {
     trans = transform;
     body = rigidbody;
     animationHandler = spriteRenderer.GetComponent<AnimationHandler>();
     spriteMat = spriteRenderer.material;
     spriteTrans = spriteRenderer.transform;
     stats.agi = 9;
     speed = stats.agi * 5;
     maxSpeed = stats.agi;
 }