コード例 #1
0
ファイル: Character.cs プロジェクト: albertus88/demo
    // Use this for initialization
    void Start()
    {
        _animator = gameObject.GetComponentInChildren<Animator> ();
        w = _animator.GetBehaviour<Walk> ();

        w.Init (velocity, transform);
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animator>();
     stateGlow = Animator.StringToHash("Photo.Glow");
     beh = anim.GetBehaviour<StateEventBehaviour>();
     beh.StateEntered += Beh_StateEntered;
     currentSprite = EmptySprite;
     img = GetComponent<Image>();
 }
コード例 #3
0
    void Awake()
    {
        animatorController = this.GetComponent<Animator>();

        if (animatorController == null) throw new MissingReferenceException("Missing a reference to the PlayerAnimatorControler on the " + this.gameObject);

        camera = this.GetComponent<Transform>();

        var zoomOutState  = animatorController.GetBehaviour<AnimationStateEventDelegator>();
        zoomOutState.OnExit += OnZoomOutExit;
    }
コード例 #4
0
    void Start()
    {
        BaseScale = MiddleCompactor.localScale.y;
        basePosT  = DownCompactor.localPosition.y;

        // Find a reference to the ExampleStateMachineBehaviour in Start since it might not exist yet in Awake.
        behaviourTop  = animatorTop.GetBehaviour <Behaviour_Compactor>();
        behaviourDown = animatorDown.GetBehaviour <Behaviour_Compactor_Down>();

        // Set the StateMachineBehaviour's reference to an ExampleMonoBehaviour to this.
        behaviourTop.compactorT  = this;
        behaviourDown.compactorT = this;
    }
コード例 #5
0
    void Start()
    {
        canTrigger = true;
        health     = 5f;
        particles.SetActive(false);
        animator = GetComponent <Animator>();
//        Physics2D.IgnoreLayerCollision(12, 12, true);
//        Physics2D.IgnoreLayerCollision(12, 13, false);

        HitStateBehaviour hitStateBehaviour = animator.GetBehaviour <HitStateBehaviour>();

        hitStateBehaviour.enemyController = this;
    }
コード例 #6
0
    private void Awake()
    {
        GameManager.Initialize();
        GameMenu.DisactivateGameMenuEvent();

        AnimationBehaviour[] animationBehaviours = characterZ2Animator.GetBehaviours <AnimationBehaviour>();
        animationBehaviours[0].OnStateExitEvent += KainSleep;
        animationBehaviours[1].OnStateExitEvent += AnimationEnd;

        characterKainAnimator.GetBehaviour <AnimationBehaviour>().OnStateExitEvent += OnKainShortToDoor;

        screenDark.SetDark(false);
    }
コード例 #7
0
    void Start()
    {
        state = State.Idle;


        cc           = GetComponent <CharacterController>();
        playerAudio  = GetComponent <AudioSource>();
        animator     = GetComponent <Animator>();
        stateMachine = animator.GetBehaviour <CheckAnimationState>();

        stateMachine.player     = this;
        stateMachine.ActionEnd += AnimationEnd;
    }
コード例 #8
0
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     playerTrans  = animator.transform.parent;
     weaponTrans  = animator.transform.Find("武器");
     weaponSprite = weaponTrans.GetComponent <tk2dSprite>();
     tkAnimator   = animator.transform.GetComponent <tk2dSpriteAnimator>();
     FunctionLock = false;
     time         = 0;
     tkAnimator.Play("前冲攻击");
     baseMovement = animator.GetBehaviour <MovementBehavior>();
     //设置速度
     baseMovement.currentSpeed = baseMovement.WalkSpeed;
 }
コード例 #9
0
    // Use this for initialization

    void Start()
    {
        GameObject  player      = GameObject.Find("Player");
        PlayerModel firstPlayer = player.GetComponent <PlayerModel> ();
        //FirstPlayer firstPlayer = player.GetComponent<FirstPlayerChild> () as FirstPlayer;
        HpBarCtrl             hpBarCtrl            = GameObject.Find("HpBarCtrl").GetComponent <HpBarCtrl> ();
        char_count            characterCount       = GameObject.Find("char_count").GetComponent <char_count> ();;
        DOOR                  DoorRefference       = GameObject.Find("Manager1").GetComponent <SaveDoor>().DOOR.GetComponent <DOOR>();
        IAlphabetQueueHandler alphabetQueueHandler = new AlphabetQueueHandler();
        Animator              playerAnimator       = player.GetComponent <Animator> ();

        playerAnimator.GetBehaviour <InEnemyCollision> ().Initialize(firstPlayer, hpBarCtrl, characterCount, DoorRefference, alphabetQueueHandler);
    }
コード例 #10
0
        private void InitCheckpoints()
        {
            PatrolBehavior patrol = animator.GetBehaviour <PatrolBehavior>();

            if (patrol)
            {
                patrol.Checkpoints = spawnPoint.Checkpoints;
            }
            else
            {
                Debug.Log("Can't find the PatrolBehavior");
            }
        }
コード例 #11
0
 public void SetAnimatorController(RuntimeAnimatorController controller)
 {
     if (animator.runtimeAnimatorController != controller)
     {
         if (actor != null)
         {
             actor.Destroy();
         }
         animator.runtimeAnimatorController = controller;
         actor = animator.GetBehaviour <AnimatorProxy>();
         actor.Init(animator);
     }
 }
コード例 #12
0
ファイル: PlayerMotor.cs プロジェクト: ostbows/ffa
    void Awake()
    {
        animator = networkAnimator.animator;
        animator.GetBehaviour <OnForwardAttack>().playerMotor = this;

        moveStates   = new MoveState();
        animatorHash = new AnimatorHash
        {
            movement      = Animator.StringToHash("movement"),
            forwardAttack = Animator.StringToHash("forwardAttack"),
            hurt          = Animator.StringToHash("hurt")
        };
    }
コード例 #13
0
 //Used to set several parameters, mostly inside the state machine. The rotation of the turret at the start is stored and the UI is set to display the right number of HP
 void Start()
 {
     m_An.GetBehaviour <Turret_Shooting>().SetParameters(m_SpeedRotation, m_DynamicVisual);
     m_An.GetBehaviour <Turret_Iddle>().SetParameters(m_SpeedRotation * 2, m_DynamicVisual);
     m_InitialOritention = m_DynamicVisual.transform.localRotation;
     m_An.GetBehaviour <Turret_Iddle>().SetOrientation(m_InitialOritention);
     m_HPText.text = m_HealthPoints.ToString();
 }
コード例 #14
0
    // Use this for initialization
    void Start()
    {
        //haetaan kaikki tarvittavat komponentit
        rb                              = GetComponent <Rigidbody>();
        healthSystem                    = GetComponent <HealthSystem>();
        healthSystem.dieHandler         = OnDie;
        keeper                          = GetComponent <PathKeeper>();
        cameraTarget                    = GameObject.Find("CameraTarget");
        movement                        = GetComponent <GroundMovement>();
        movement.OnHitGround            = OnHitGround;
        anim                            = transform.Find("PlayerModel").GetComponent <Animator>();
        damageBlinker                   = GetComponent <MaterialBlinker>();
        footStepHandler                 = transform.Find("PlayerModel").GetComponent <FootstepHandler>();
        footStepHandler.FootStepHandler = Footstep;

        //animaatiot
        anim.SetFloat("RunBlend", 0f);
        animBaseLayer    = anim.GetLayerIndex("BaseLayer");
        animFallLayer    = anim.GetLayerIndex("FallLayer");
        animHurtLayer    = anim.GetLayerIndex("HurtLayer");
        animJumpLayer    = anim.GetLayerIndex("JumpLayer");
        animLandingLayer = anim.GetLayerIndex("LandingLayer");

        anim.GetBehaviour <AttackLayerScript>().OnSlashEndHandler = OnSlashEnd;
        swordHitbox.SetActive(false);

        //lataa pelaajan tilanne tallennuksesta
        GameData.Player playerData = GameDataManager.Instance.GameData.player;
        if (playerData.firstCheckPointReached)
        {
            //paikka, suunta ja polku
            transform.position   = playerData.position.toVector3();
            transform.rotation   = playerData.rotation.toQuaternion();
            keeper.currentSpline = GameObject.Find(playerData.pathName).GetComponent <BezierSpline>();
            //health
            healthSystem.currentHealth = playerData.currentHealth;
            healthSystem.maxHealth     = playerData.maxHealth;
        }

        //siirrä kamera pelaajan paikalle
        cmDefaultCamera = GameObject.FindGameObjectWithTag("CMDefaultCamera");
        mainCamera      = GameObject.FindGameObjectWithTag("MainCamera");
        if (cmDefaultCamera != null)
        {
            cmDefaultCamera.SetActive(false);
            mainCamera.SetActive(false);
            cmDefaultCamera.transform.position = transform.position;
            mainCamera.transform.position      = transform.position;
            StartCoroutine(ActivateCameras());
        }
    }
コード例 #15
0
 void Awake()
 {
     singleton = this;
     //Pega os componentes necessarios
     _rigidbody = GetComponent <Rigidbody> ();
     _animator  = GetComponent <Animator>();
     //Configura a velocidade do jogador no inicio do jogo
     movimentoVelocidadeInicial = movimentoVelocidade;
     //Define as condicoes do jogador
     //Soco
     socoPodeSocar   = true;
     socoEstaSocando = false;
     socoCarregado   = socoForcaInicio;
     //Movimento
     movimentoPode = true;
     //Pulo
     puloPulando   = false;
     puloPodePular = true;
     puloIntervalo = false;
     //Laser
     laserFritando = false;
     //Outros
     jogadorProtecaoRespawn = false;
     //IMPORTANTE pois se o valor for 0 a animaçãode socar nao funciona
     powerUpAgilidadeMultiplicador = 1f;
     //Animacao
     //Pega os scripts das animacoes
     socoAnimacao = _animator.GetBehaviours <SocoAnimacaoResetar>();
     jogadorLevantandoAnimacao = _animator.GetBehaviour <JogadorLevantandoStateMachine>();
     jogadorDashAnimacao       = _animator.GetBehaviour <JogadorDashStateMachine>();
     //Configura a instancia do jogador nos scripts da animacao
     foreach (SocoAnimacaoResetar animacao in socoAnimacao)
     {
         animacao.jogadorReferencia = this;
     }
     jogadorLevantandoAnimacao.jogadorReferencia = this;
     jogadorDashAnimacao.jogadorReferencia       = this;
 }
コード例 #16
0
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        m_aiBuildObstacles   = animator.GetBehaviour <AIBuildObstacle> ();
        m_aiDestroyObstacle  = animator.GetBehaviour <AIDestroyObstacle> ();
        m_aiCreateTeam       = animator.GetBehaviour <AICreateTeam> ();
        m_aiFindCkOnPath     = animator.GetBehaviour <AIFindCkOnPath> ();
        m_aiRandomActions    = animator.GetBehaviour <AIRandomActions> ();
        m_aiGroupOfUnits     = animator.GetBehaviour <AIGroupOfUnits> ();
        m_aiFindClosestBuild = animator.GetBehaviour <AIFindClosestBuild> ();

        animator.SetBool(Constant.BotTransition.s_randomActions, false);
    }
コード例 #17
0
    void OnStateEnter(Animator animator)
    {
        if (!buildingState)
        {
            buildingState = animator.GetBehaviour <BuildingPlayerState>();
        }

        var mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);

        buildingState.placingPart = Instantiate(buildingState.selectedPart, mousePosition, buildingState.placementRotation).GetComponent <PartController>();

        PartController.GetAllParts().ForEach(part => part.SetMode(PartMode.Build));
        buildingState.placingPart.SetMode(PartMode.BuildGhost);
    }
コード例 #18
0
ファイル: MegaAI.cs プロジェクト: DeflatedPickle/Psionide
    private void Awake()
    {
        _animator = GetComponent <Animator>();
        ShootAt   = gameObject.AddComponent <ShootAt>();

        _megaStateMachine        = _animator.GetBehaviour <MegaStateMachine>();
        _megaStateMachine.MegaAi = this;

        ShootAt.Target      = GameObject.Find("PlayerPrefab").transform;
        ShootAt.Shooter     = transform;
        ShootAt.Bullet      = Bullet;
        ShootAt.BulletSpeed = 5f;
        ShootAt.Interval    = 150f;
    }
コード例 #19
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     robotic_wall.Set_Robotic_Wall(animator.gameObject);
     statesController = GameObject.Find("StatesController").GetComponent <FSMSystem>();
     statesList       = statesController.GetStatesList();
     wall_requester   = GameObject.Find("User_Encounter_Area").GetComponent <Wall_Requester>();
     //put the wall which the elevator setteled in to sloved List
     ele_wall      = GameObject.Find("Wall_Elevator_True");
     eleva         = animator.GetBehaviour <ElevatorState>().GetElevator();
     ele_requester = eleva.GetComponent <Elevator_Requester>();
     Debug.Log("eleva =" + ele_wall.name);
     wall_requester.SetWallSolved(ele_wall);
     ele_requester.AllocateElevator(animator);
 }
コード例 #20
0
    // Use this for initialization
    void Start()
    {
        if (myRB != null)
        {
            return;
        }
        else
        {
            myRB = gameObject.GetComponent <Rigidbody>();
        }

        if (myAnim != null)
        {
            return;
        }
        else
        {
            myAnim = gameObject.GetComponent <Animator>();
        }

        On_IsPlayerNearby_Sent += myAnim.GetBehaviour <PatrolFSM>().On_IsPlayerNearby_Received;
        On_IsPlayerNearby_Sent += myAnim.GetBehaviour <AttackFSM>().On_IsPlayerNearby_Received;
    }
コード例 #21
0
        public void Initialize()
        {
            this.modelViewer.Initialize(new Vector3(0f, 5000f, 0f));
            this.modelViewer.SetCameraViewOffset(-80f, 0f);
            this.modelViewer.EnableTouchEvent(false);
            this.returnButtonCollider.enabled = false;
            Animator component = base.gameObject.GetComponent <Animator>();
            ChangeModelViewerAnimationEvent behaviour = component.GetBehaviour <ChangeModelViewerAnimationEvent>();

            if (null != behaviour)
            {
                behaviour.SetModelViewer(this.modelViewer, this.returnButtonCollider);
            }
        }
コード例 #22
0
    private void Awake()
    {
        state         = State.Idle;
        startPosition = transform.position;
        rbody         = GetComponent <Rigidbody>();
        sound         = GetComponent <AudioSource>();
        animator      = GetComponent <Animator>();
        var eventsInvoker = animator.GetBehaviour <AnimationEventsInvoker>();

        eventsInvoker.stateEndEvent.AddListener(OnAnimationEnd);
        squash     = GetComponent <SquashEffect>();
        attack     = GetComponentInChildren <AttackHitBox>();
        healthComp = GetComponent <EnemyHealth>();
    }
コード例 #23
0
ファイル: Ref.cs プロジェクト: gilpark/qb_challenge
    /// <summary>
    /// b/c of Ref need to be on/off every round so it pushes only 1 time and gets destroied.
    /// </summary>
    private void OnEnable()
    {
        Animator.GetBehaviour <RefCall_AC>()
        .OnStateExitObservable
        .Take(1)
        .Subscribe(_ => RefAniStream.OnNext(new Unit()))
        .AddTo(gameObject);

        Animator.GetBehaviour <RefCall_AC1>()
        .OnStateExitObservable
        .Take(1)
        .Subscribe(_ => RefAniStream.OnNext(new Unit()))
        .AddTo(gameObject);

        RefAniStream
        .Take(1)
        .Subscribe(x =>
        {
            PlayerCam.enabled = true;
            gameObject.SetActive(false);
        })
        .AddTo(gameObject);
    }
コード例 #24
0
    private void Update()
    {
        /*First, we check if the vehicle is shooting, if the target is in the world and if the vehicle is close enough.
         * If so, we set the orientation that will be used to rotate the vehicle toward its target.
         * Then we send this orientation to the state machine to do the rotation.
         * The vehicle has now a target and can't change it until it's destroyed
         *
         * If the vehicle is shooting, we check if this target is no longer in the world.
         * When it's null, it means the target has been destroyed. If so, the vehicle can go back to its driving behavior.
         */
        if (m_IsShooting && Manager_Input.Instance.m_Target != null && (Vector3.Distance(this.transform.position, Manager_Input.Instance.m_Target.transform.position) < m_DistanceToTarget))
        {
            m_Orientation = Quaternion.LookRotation(Manager_Input.Instance.m_Target.transform.position - transform.position);
            m_An.GetBehaviour <Car_Shooting>().SetOrientation(m_Orientation);
        }

        else if (m_IsShooting && Manager_Input.Instance.m_Target == null)
        {
            DrivingBehavior();
        }


        /*
         * We check if the RoadBlock is in the world and if the distance between the vehicle and the roadblock is less than the maximum distance.
         * If so, we stop the agent.
         * Else, if the RoadBlock is no longer in the world or the vehicle is far enough, we check if the vehicle is driving, by using the bool inside the state machine.
         * If so, the agent can move.
         */
        if (Manager_Objects.Instance.m_RoadBlock != null && Vector3.Distance(this.transform.position, Manager_Objects.Instance.m_RoadBlock.transform.position) < m_DistanceToRoadBlock)
        {
            m_Agent.isStopped = true;
        }
        else if (m_An.GetBool("m_Driving"))
        {
            m_Agent.isStopped = false;
        }
    }
コード例 #25
0
    public void ResumeRegister()
    {
        m_networkService.Register(NetWorkCommandType.EnemyAttackResult, OnEnemyAttackResult);
        m_networkService.Register(NetWorkCommandType.EnemyGunShootResult, OnEnmeyGunShootResult);
        m_networkService.Register(NetWorkCommandType.SelfDestructResult, OnSelfDestructResult);
        m_networkService.Register(NetWorkCommandType.DriveTankResult, OnDriveTankResult);
        m_networkService.Register(NetWorkCommandType.Shoot, OnShoot);

        var shoottingOverBehaviour = m_animator.GetBehaviour <ShootingOverBehaviour>();

        shoottingOverBehaviour.CallBack = () =>
        {
            m_animator.SetBool("Shooting", false);
        };

        var rechargeOverBehaiour = m_animator.GetBehaviour <RechargeOverBehaviour>();

        rechargeOverBehaiour.CallBack = () =>
        {
            m_animator.SetBool("Recharge", false);
        };

        var deathOverBehaviour = m_animator.GetBehaviour <DeathOverBehaviour>();

        deathOverBehaviour.CallBack = () =>
        {
            // m_animator.SetBool("Death", false);
        };

        var damagedBehaviour = m_animator.GetBehaviour <DamangedOverBehaviour>();

        damagedBehaviour.CallBack = () =>
        {
            m_animator.SetBool("Damaged", false);
        };
    }
コード例 #26
0
    // Use this for initialization
    public override void Initialize(Material _parent)
    {
        MovingObject _parentObj = _parent as MovingObject;

        if (_parentObj != null)
        {
            animator          = _parentObj.GetAnimator();
            animatorStateData = animator.GetBehaviour <AnimatorSaveScript>().GetData(animator);
            base.Initialize(_parentObj);
        }
        else
        {
            Debug.LogException(new Exception("MovingObject Memento expected parent to be a MovingObject!"), this);
        }
    }
コード例 #27
0
    // Start is called before the first frame update
    void Start()
    {
        tower           = gameObject.GetComponentInParent <Tower>();
        monster         = gameObject.GetComponentInParent <Monster>();
        monsterAnimator = gameObject.GetComponent <Animator>();
        idleTime        = monsterAnimator.GetBehaviour <IdleTime>();



        monsterAnimator.speed = 1 * ((float)monster.info.speBase / 75);
        animatorSpeed         = monsterAnimator.speed;
        dexId = monster.info.dexId;
        monsterAnimator.SetFloat("attackSpeed", animatorSpeed);
        monsterAnimator.SetInteger("dexID", dexId);
    }
コード例 #28
0
    // Use this for initialization
    void Start()
    {
        animator        = GetComponent <Animator>();
        attackStates    = new AttackStateMachine[maxCombo];
        attackStates[0] = animator.GetBehaviour <Attack1StateMachine>();
        attackStates[1] = animator.GetBehaviour <Attack2StateMachine>();
        attackStates[2] = animator.GetBehaviour <Attack4StateMachine>();
        attackStates[3] = animator.GetBehaviour <Attack3StateMachine>();

        maxCombo = attackStates.Length;

        control = GetComponent <StriderControl>();
        foreach (AttackStateMachine att in attackStates)
        {
            print(att.name);
            att.SetStriderControl(control);
            att.SetAttackControl(this);
        }

        centerX = GetComponent <Renderer>().bounds.size.x / 2.0f;
        centerY = GetComponent <Renderer>().bounds.size.y / 2.0f;

        attackQueue = new Queue <int>();
    }
コード例 #29
0
    void AnimatorScriptsInitialisierung()
    {
        SpawnStateScript spawnScript = anim.GetBehaviour <SpawnStateScript>();

        if (spawnScript != null)
        {
            spawnScript.myCharacter = this;
        }
        else
        {
            Debug.LogError("spawnScript not found!!!");
        }

        SpawnDelayStateScript spawnDelayScript = anim.GetBehaviour <SpawnDelayStateScript>();

        if (spawnDelayScript != null)
        {
            spawnDelayScript.myCharacter = this;
        }
        else
        {
            Debug.LogError("spawnDelayScript not found!!!");
        }
    }
コード例 #30
0
        // Use this for initialization
        void Start()
        {
            agent = GetComponent <Agent>();

            var seekBe      = agent.GetComponent <SeekBehaviour>();
            var fleeBe      = agent.GetComponent <FleeBehaviour>();
            var shootAction = agent.GetComponent <ShootAction>();

            var goToBaseState = aiAnimator.GetBehaviour <GoToBaseState>();

            goToBaseState.agent  = agent;
            goToBaseState.seekBe = seekBe;
            goToBaseState.fleeBe = fleeBe;

            var attackEnemyState = aiAnimator.GetBehaviour <AttackEnemyState>();

            attackEnemyState.agent       = agent;
            attackEnemyState.seekBe      = seekBe;
            attackEnemyState.fleeBe      = fleeBe;
            attackEnemyState.shootAction = shootAction;

            var getHealthState = aiAnimator.GetBehaviour <GetHealthState>();

            getHealthState.agent  = agent;
            getHealthState.seekBe = seekBe;
            getHealthState.fleeBe = fleeBe;

            var RunAwayState = aiAnimator.GetBehaviour <RunAwayState>();

            RunAwayState.agent  = agent;
            RunAwayState.seekBe = seekBe;
            RunAwayState.fleeBe = fleeBe;

            // Animator runs before Update, so we do the first check now
            MakeDecision();
        }
コード例 #31
0
        public void Start()
        {
            character = GetComponent <Character> ();
            Debug.Assert(character != null);
            animator = GetComponentInChildren <Animator> ();
            Debug.Assert(animator != null);
            blockComponent = GetComponent <BlockComponent> ();
            Debug.Assert(blockComponent != null);

            movement  = new Movement(character, blockComponent);
            targeting = new Targeting(character);

            animationEvents = animator.GetBehaviour <CritterAnimationEvents> ();
            Debug.Assert(animationEvents != null);
        }
コード例 #32
0
    void Update()
    {
        if (currPart > person.Length || !animator.GetBehaviour <InitalStart> ().passed)
        {
            thisGroup.interactable = false;
            thisGroup.alpha        = 0;
        }
        else
        {
            thisGroup.alpha        = 1;
            thisGroup.interactable = true;
        }
//		menuCanvas.SetActive(isShowing);
        //menuCanvas.SetActive(initalScene.GetBehaviour <InitalStart> ().passed);
    }
コード例 #33
0
    // Use this for initialization
    void Awake()
    {
        ResourceValueUI = gameObject.GetComponent <Text>();
        animator        = gameObject.GetComponent <Animator>();
        addResource     = animator.GetBehaviour <AddResource>();
        animator.SetBool("IsStart", false);
        _resourceByCycle        = HingeConfig._AddResourceByCycle;
        _cycle                  = HingeConfig._AddResourceCycle;
        addResource.resource    = _resourceByCycle;
        ResourceValueUI.text    = "Resource +" + _resourceByCycle;
        ResourceValueUI.enabled = false;
        float ProductingSpeed = 1 / _cycle;

        animator.SetFloat("ProductingSpeed", ProductingSpeed);
    }
コード例 #34
0
    // Use this for initialization
    void Start()
    {
        cont = FPSPlayer.GetComponent<PlayerController>();
        parts = GetComponent<ParticleSystem>();
        targetScript = TargetImage.GetComponent<PageImageScript>();
        nbscript = Notebook.GetComponent<NotebookScript>();

        stateSpinning = Animator.StringToHash("Card.Spinning");
        stateStopped = Animator.StringToHash("Card.Stopped");
        statePutaway = Animator.StringToHash("Card.Putaway");

        anim = GetComponentInChildren<Animator>();
        beh = anim.GetBehaviour<StateEventBehaviour>();
        beh.StateEntered += Beh_StateEntered;
        beh.StateExited += Beh_StateExited;
        //        linkedScripts = LinkedCards.Select(i => i.GetComponent<CardScript>()).ToArray();
    }
コード例 #35
0
    // Use this for initialization
    void Start()
    {
        firstMesh = FirstPage.GetComponent<MeshRenderer>();
        secondMesh = SecondPage.GetComponent<MeshRenderer>();
        cont = FPSPlayer.GetComponent<PlayerController>();

        anim = GetComponent<Animator>();
        beh = anim.GetBehaviour<StateEventBehaviour>();
        beh.StateEntered += Beh_StateEntered;
        beh.StateExited += Beh_StateExited;

        idleState = Animator.StringToHash("Notebook.Idle");
        forwardState = Animator.StringToHash("Notebook.Forward");
        backwardState = Animator.StringToHash("Notebook.Backward");
        closedState = Animator.StringToHash("Notebook.Closed");
        lastInfo = anim.GetCurrentAnimatorStateInfo(0);
        audioSource = GetComponent<AudioSource>();
    }
コード例 #36
0
 public void ResetStateManager(Animator _animator)
 {
     attackState = _animator.GetBehaviour<CharacterAttackState> ();
     deadState = _animator.GetBehaviour<CharacterDeadState> ();
     skillState = _animator.GetBehaviour<CharacterSkillState>();
 }
コード例 #37
0
    // SAMPLE TEXT  that is hardcoded for now//
    // -- Can be somewhat dynamic later on -- //
    // Use this for initialization
    void Start()
    {
        //menuCanvas.SetActive(false);

        animator = animator.GetComponent<Animator>();

        portrait = portrait.GetComponent<Image>();

        animator.GetBehaviour <TransClass> ().transition=nextScene;

        for(int i=0; i< charsToLoad; ++i)
            charImg[i]=charImg[i].GetComponent<Image>();

        charName = charName.GetComponent<Text>();
        continueText=continueText.GetComponent<Button>();
        convoText= convoText.GetComponent<Button>();

        portrait.sprite=charImg[person[currPart]].sprite;
        charName.text=charImg[person[currPart]].tag;
        convoText.GetComponentInChildren<Text>().text=speech[currPart++];
        //menuCanvas.SetActive();
    }
コード例 #38
0
 // Use this for initialization
 void Start()
 {
     m_characterCtrl = GetComponent<CharacterController>();
     m_animator = GetComponent<Animator>();
     damageController = GetComponent<DamageController>();
     AttackBehaviour ab = m_animator.GetBehaviour<AttackBehaviour>();
     //ab.damageController = damageController;
     target = GameObject.Find("ashe");
     navAgent = GetComponent<NavMeshAgent>();
     Shader.WarmupAllShaders();
 }