Beispiel #1
0
    void Awake()
    {
        string gTiles = mapGrappleable.text;

        gTiles       = Utils.RemoveLineEndings(gTiles);
        grappleTiles = new List <int>();
        unsafeTiles  = new List <int>();
        for (int i = 0; i < gTiles.Length; i++)
        {
            switch (gTiles[i])
            {
            case 'S':
                grappleTiles.Add(i);
                break;

            case 'X':
                unsafeTiles.Add(i);
                break;
            }
        }
        dray      = GetComponent <ChangedDray>();
        rigid     = GetComponent <Rigidbody>();
        anim      = GetComponent <Animator>();
        drayColld = GetComponent <Collider>();
        Transform trans = transform.Find("Grappler");

        grapHead = trans.gameObject;
        grapLine = grapHead.GetComponent <LineRenderer>();
        grapHead.SetActive(false);
    }
Beispiel #2
0
    void Start()
    {
        sword = transform.Find("Sword").gameObject;
        dray  = transform.parent.GetComponent <ChangedDray>();

        // Deactivate the sword
        sword.SetActive(false);
    }