Esempio n. 1
0
    private void Awake()
    {
        // Get collider sizes
        ColliderSize();

        // Load prefab
        enemyMushroom = Resources.Load <EnemyMushroom>("MushObstacle");

        // Simulating segment ID
        segmentNumber = SegmentInfo.AddSegment();

        spriteRenderer = GetComponent <SpriteRenderer>();

        // If it's a first segment in centipede - make it main(head)
        if (isFirst)
        {
            spriteRenderer.sprite = Resources.Load <Sprite>("EnemyHead2");
        }
        else
        {
            spriteRenderer.sprite = Resources.Load <Sprite>("EnemyHead4");
        }

        GetCameraSizes();

        position  = new Vector3(0, maxY - 1);
        direction = new Vector3(0.1f, 0);
    }