Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        mover  = GetComponent <IMovement>();
        weapon = GetComponent <IActuator>();
        if (eventChannel == null)
        {
            eventChannel = PartUtil.GetEventChannel(gameObject);
            Debug.Log("eventChannel: " + eventChannel);
        }
        // determine when bot flips
        StartCoroutine(DetectFlip());

        // determine when bot dies
        var botHealth = GetComponent <BotHealth>();

        if (botHealth != null)
        {
            botHealth.onDeath.AddListener(OnBotDeath);
        }
        if (controlsActive)
        {
            EnableControls();
        }
    }