Exemplo n.º 1
0
    /// <summary>
    /// Atualiza referência do flex attack
    /// </summary>
    /// <returns>Retorna a referência do FlexAttack</returns>
    public FlexAttack updateFlexAttackRef()
    {
        GameObject gameManager = GameObject.FindGameObjectWithTag("GameManager");

        if (gameManager != null)
        {
            flexAttack = gameManager.GetComponent <FlexAttack>();
        }
        return(flexAttack);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        animator = GetComponentInChildren <Animator>();
        GameObject gameManager = GameObject.FindGameObjectWithTag("GameManager");

        flexAttack = gameManager.GetComponent <FlexAttack>();
        if (flexAttack != null)
        {
            flexAttack.addCapivara(this);
        }
    }
Exemplo n.º 3
0
    private void Start()
    {
        GameObject gameManager = GameObject.FindGameObjectWithTag("GameManager");
        FlexAttack flexAttack  = gameManager.GetComponent <FlexAttack>();

        if (flexAttack != null)
        {
            flexAttack.addExplosive(gameObject);
        }
        Rigidbody2D rb2d = GetComponent <Rigidbody2D>();

        rb2d.gravityScale = 0;
    }
Exemplo n.º 4
0
    private void OnEnable()
    {
        flexAttack      = attacker.updateFlexAttackRef();
        reorderableList = new ReorderableList(flexAttack.attackers, typeof(Attacker), true, true, true, true);

        // This could be used aswell, but I only advise this your class inherrits from UnityEngine.Object or has a CustomPropertyDrawer
        // Since you'll find your item using: serializedObject.FindProperty("list").GetArrayElementAtIndex(index).objectReferenceValue
        // which is a UnityEngine.Object
        // reorderableList = new ReorderableList(serializedObject, serializedObject.FindProperty("list"), true, true, true, true);

        // Add listeners to draw events
        reorderableList.drawHeaderCallback  += DrawHeader;
        reorderableList.drawElementCallback += DrawElement;

        reorderableList.displayAdd        = false;
        reorderableList.onRemoveCallback += RemoveItem;
    }