//event method
 public void SuperballIsBuilt()
 {
     sphereCollider        = GameObject.Find("Sphere").GetComponent <SphereCollider>();
     sbBehavior            = GameObject.Find("Sphere").GetComponent <SuperballBehavior>();
     ballBehaviorTrackable = true;
     print("Ball behavior is trackable now!");
 }
    public float timeUntilLaunch; //how long can they hold onto the ball before it launches?

    void Start()
    {
        reaimingActive = false;
        ballPosition   = Vector3.zero;
        roomCamera     = GameObject.Find("RoomCamera");
        sbBehavior     = GameObject.Find("Sphere").GetComponent <SuperballBehavior>();
        superballRBody = GameObject.Find("Sphere").GetComponent <Rigidbody>();
        arrowsBehavior = GameObject.Find("Arrows").GetComponent <ArrowsBehavior>();
    }
Exemplo n.º 3
0
    private Stack <GameObject> destroyedObjects; //keep this to restart things

    void Start()
    {
        destroyedObjects = new Stack <GameObject>();

        ballCannonTransform = Cannon.transform;
        Sphere = GameObject.Instantiate(this.Sphere, Cannon.transform, false);
        Sphere.gameObject.name = "Sphere";
        sbBehavior             = Sphere.GetComponent <SuperballBehavior>();
        ExecuteEvents.Execute <ISuperballInstantiatedEvent>(Cannon, null, (x, y) => x.SuperballIsBuilt());
        ExecuteEvents.Execute <ISuperballInstantiatedEvent>(Arrows, null, (x, y) => x.SuperballIsBuilt());
        ExecuteEvents.Execute <ISuperballInstantiatedEvent>(GameObject.Find("RoomCamera"), null, (x, y) => x.SuperballIsBuilt());

        root.worldCamera = StartMenuCamera;
        currentGameState = GameState.STARTMENU;
        CannonCamera.GetComponent <Camera>().enabled    = false;
        StartMenuCamera.GetComponent <Camera>().enabled = true;
        StartMenu.gameObject.SetActive(true);
    }
Exemplo n.º 4
0
 public void SuperballIsBuilt()
 {
     ball                  = GameObject.Find("Sphere");
     sbBehavior            = GameObject.Find("Sphere").GetComponent <SuperballBehavior>();
     ballBehaviorTrackable = true;
 }