示例#1
0
    public void ReloadLevel()
    {
        int nextLevelID = Application.loadedLevel;

        PlatformInputController.flushEvents();
        Application.LoadLevel(nextLevelID);
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        leftBoundary = 0f;
        rightBoundary = 15f;

        playerObject = GameObject.Find("Player");
        motor = playerObject.GetComponent<CharacterMotor>();
        pic = playerObject.GetComponent<PlatformInputController>();
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        motor = gameObject.GetComponent<CharacterMotor>();
        pic = gameObject.GetComponent<PlatformInputController>();
        heart = GameObject.Find ("Player").GetComponent<HeartBeat>();

        GameObject.Find("Spawn Particles").GetComponent<ParticleSystem>().Play(true);

        boost = 3.0f;
    }
示例#4
0
 // Use this for initialization
 void Start()
 {
     leafmaterial = GameObject.Find("MainLine001");
     leafmaterial.renderer.material = material1;
     leaf = GameObject.Find("leaf1");
     //leaf.animation["idle"].wrapMode = WrapMode.Loop;
     controller = GetComponent<CharacterController>();
     inputcontroller = GetComponent<PlatformInputController>();
     soundmanager = GameObject.Find("SoundManager").GetComponent<SoundManager>();
     cameramanager = GameObject.Find("MainCamera").GetComponent<CameraManager>();
     CameraIntro = GameObject.Find("CameraIntro");
 }
示例#5
0
    public void AddPlatform(PlatformInputController platform)
    {
        if (platform == null)
        {
            return;
        }

        PlatformInputController reference;

        if (!platforms.TryGetValue(platform.GetInstanceID(), out reference))
        {
            platforms.Add(platform.GetInstanceID(), platform);
            reference = platform;
        }

        reference.enabled = false;
    }
示例#6
0
    // Use this for initialization
    void Start()
    {
        dummy = GameObject.Find("Fitzwilliam/dummy");
        t = transform;
        motor = GetComponent<CharacterMotor>();
        controller = GetComponent<PlatformInputController>();

        anim = dummy.GetComponent<tk2dAnimatedSprite>();

        leftWall = GameObject.Find(name + "/LeftWallDetector").GetComponent<BoxCollider>();
        rightWall = GameObject.Find(name + "/RightWallDetector").GetComponent<BoxCollider>();

        GameObject[] allWallGrabTargets = GameObject.FindGameObjectsWithTag("wallGrabTarget");		//getting all my wall grab targets!
        List<BoxCollider> boxes = new List<BoxCollider>();
        foreach (GameObject go in allWallGrabTargets){
            boxes.Add (go.GetComponent<BoxCollider>());
        }
        wallGrabTargets = boxes.ToArray();

                //storing my initial movement values!
        initMoveValues.gravity = motor.movement.gravity;
        initMoveValues.groundAccel = motor.movement.maxGroundAcceleration;
        initMoveValues.runSpeed = motor.movement.maxRunSpeed;
        initMoveValues.walkSpeed = motor.movement.maxWalkSpeed;
        initMoveValues.maxFallSpeed = motor.movement.maxFallSpeed;
    }
示例#7
0
 /// <summary>
 /// If the platform is the current selected platform
 /// </summary>
 /// <param name="platform"></param>
 /// <returns></returns>
 public bool isSelected(PlatformInputController platform)
 {
     return(currentPlatform == platform.GetInstanceID());
 }