コード例 #1
0
    void Awake()
    {
        blinkController = GetComponent <BlinkController>();
        rend            = GetComponentInChildren <Renderer>();
        col             = GetComponent <BoxCollider>();
        voxelization    = GetComponentInChildren <VoxelizationClient>();
        bodyState       = BodySubState.NORMAL;

        bodyDeactivate = new ParticleSystem[bodyDeactivatePrefabs.Length];

        Transform fx = transform.FindDeepChild("FX");

        GameObject temp;

        for (int i = 0; i < bodyDeactivatePrefabs.Length; ++i)
        {
            temp = Instantiate(bodyDeactivatePrefabs[i]);
            temp.transform.SetParent(fx);
            temp.transform.localPosition = Vector3.zero;
            bodyDeactivate[i]            = temp.GetComponent <ParticleSystem>();
        }

        temp = Instantiate(bodyDestructionPrefab);
        temp.transform.SetParent(fx);
        temp.transform.localPosition = Vector3.zero;
        bodyDestruction = temp.GetComponent <ParticleSystem>();

        overground   = false;
        invulnerable = false;
    }
コード例 #2
0
 protected virtual void Awake()
 {
     voxelization    = GetComponentInChildren <VoxelizationClient>();
     rend            = GetComponentInChildren <Renderer>();
     mainCollider    = GetComponent <Collider>();
     dyingCollider   = transform.FindDeepChild("DyingCollider").gameObject;
     blinkController = GetComponent <BlinkController>();
 }
コード例 #3
0
	// Use this for initialization
	void Awake ()
    {
        defaultState = new SpiderAIDefaultState(this);
        closeState = new AIBaseState(this);
        attackChipState = new AIBaseState(this);
        voxelization = GetComponent<VoxelizationClient>();
        spiderRenderer = GetComponentInChildren<Renderer>();
    }
コード例 #4
0
    void Awake()
    {
        bb = new PlayerBlackboard();
        bb.Init(this);
        bb.shield    = shield;
        shieldRend   = shield.GetComponent <Renderer>();
        voxelization = GetComponentInChildren <VoxelizationClient>();
        ctrl         = GetComponent <CharacterController>();

        trail = GetComponentInChildren <TrailRenderer>();

        noShootPSGO = noShootPS.gameObject;

        init = true;
        //Debug.Log("Player " + playerId + " created.");
    }
コード例 #5
0
    void Awake()
    {
        Debug.Log("Player " + playerId + " created.");
        rend = GetComponentInChildren<Renderer>();
        
        ctrl = GetComponent<CharacterController>();
        voxelization = GetComponent<VoxelizationClient>();

        string player = "";
        switch (playerId)
        {
            case 1: player = "P1"; break;
            case 2: player = "P2"; break;
        }

        moveHorizontal = player + "_Horizontal";
        moveVertical = player + "_Vertical";
        aimHorizontal = player + "_AimHorizontal";
        aimVertical = player + "_AimVertical";
        fire = player + "_Fire";
        dash = player + "_Dash";
        playerRayCastMask = LayerMask.GetMask(player + "RayCast");
    }
コード例 #6
0
 void Awake()
 {
     voxelization = GetComponentInChildren <VoxelizationClient>();
     rend         = GetComponentInChildren <Renderer>();
     overground   = false;
 }
コード例 #7
0
	// Use this for initialization
	void Awake ()
    {     
        voxelization = GetComponent<VoxelizationClient>();      
	}
コード例 #8
0
 //Unity methods
 void Awake()
 {
     playerRayCastMask = LayerMask.GetMask("PlayerRayCast");
     rigidBody = GetComponent<Rigidbody>();
     voxelization = GetComponent<VoxelizationClient>();
 }
コード例 #9
0
    //Unity methods
    void Awake()
    {
        Debug.Log("Player " + playerId + " created.");
        rend = GetComponentInChildren<Renderer>();
        ctrl = GetComponent<CharacterController>();
        voxelization = GetComponent<VoxelizationClient>();

        spawningState = new PlayerSpawningState();
        idleState = new PlayerIdleState();
        longIdleState = new PlayerLongIdleState();
        movingState = new PlayerMovingState();
        dashingState = new PlayerDashingState();
        specialState = new PlayerSpecialState();
        swingingState = new PlayerSwingingState();
        receivingDamageState = new PlayerReceivingDamageState();
        fallingState = new PlayerFallingState();
        dyingState = new PlayerDyingState();

        spawningState.Init(this);
        idleState.Init(this);
        longIdleState.Init(this);
        movingState.Init(this);
        dashingState.Init(this);
        specialState.Init(this);
        swingingState.Init(this);
        receivingDamageState.Init(this);
        fallingState.Init(this);
        dyingState.Init(this);

        currentState = spawningState;

        string player = "";
        switch (playerId)
        {
            case 1: player = "P1"; break;
            case 2: player = "P2"; break;
        }

        moveHorizontal = player + "_Horizontal";
        moveVertical = player + "_Vertical";
        aimHorizontal = player + "_AimHorizontal";
        aimVertical = player + "_AimVertical";
        fire = player + "_Fire";
        dash = player + "_Dash";
        special = player + "_Special";

        playerRayCastMask = LayerMask.GetMask(player + "RayCast");
        animator = GetComponent<Animator>();
    }