// Start is called before the first frame update
    void Start()
    {
        randomWalking         = new ScaryCuboidMoveController(gameObject, Speed, 0.1f);
        followPlayerMovement  = new FollowMoveController(gameObject, Speed);
        currentMoveController = randomWalking;
        moveSwitchModeTimer   = changeMoveModeStartTimer;

        attackManager = GetComponent <CuboidAttackManager>();
    }
Exemple #2
0
    // Start is called before the first frame update
    void Start()
    {
        sharedLineMaterial = new Material(sourceMaterialToCopy);
        var renderers = linesContainer.GetComponentsInChildren <SpriteRenderer>();

        foreach (Renderer rend in renderers)
        {
            rend.sharedMaterial = sharedLineMaterial;
        }
        collidingPlayers = linesContainer.GetComponent <CollidingPlayers>();
        mgr = gameObject.GetComponent <CuboidAttackManager>();
    }
    // Start is called before the first frame update
    void Start()
    {
        linesContainer = Instantiate(linesContainerPrefab, transform.position, Quaternion.identity);
        linesContainer.SetActive(false);
        sharedLineMaterial = new Material(sourceMaterialToCopy);
        var renderers = linesContainer.GetComponentsInChildren <SpriteRenderer>();

        foreach (Renderer rend in renderers)
        {
            rend.sharedMaterial = sharedLineMaterial;
        }
        collidingPlayers = linesContainer.GetComponent <CollidingPlayers>();
        mgr = gameObject.GetComponent <CuboidAttackManager>();
    }