Inheritance: MonoBehaviour
Exemplo n.º 1
0
    //胜利或输了之后退出
    public void OnPointerVictoryQuit()
    {
        Controller2 code = controller2.GetComponent <Controller2>();

        code.gameObject.GetComponent <AudioSource>().Stop();
        code.enabled = false;
        code.isStart = 4;
        code.number  = 0;
        code.deadNum = 100;
        controller2.GetComponent <Controller2>().enemys = new List <GameObject>();
        foreach (GameObject tower in code.towers)
        {
            Destroy(tower);
        }
        controller2.GetComponent <Controller2>().towers = new List <GameObject>();

        selfAudioSource.loop = true;
        battleScene.SetActive(false);
        pause.GetComponent <Button>().interactable  = true;
        pause.GetComponent <EventTrigger>().enabled = true;
        site.GetComponent <Button>().interactable   = true;
        site.GetComponent <EventTrigger>().enabled  = true;
        victory.SetActive(false);
        selfAudioSource.Stop();
        cutover.SetActive(true);
        soundAudioSource.clip = audios[4];
        soundAudioSource.Play();
        Invoke("BattleSceneQuitDelay", 4.0f);
        background.GetComponent <SpriteRenderer>().sprite = sprites[1];
    }
 private void Motor2Stop_Click(object sender, EventArgs e)
 {
     if (Controller2 != null)
     {
         Controller2.StopMotor();
     }
 }
Exemplo n.º 3
0
	void Start () {
		musicManager = FinalSceneMusicManager.getInstance ();
		musicManager.playTrack (0); //E1
		ghostSwitchManager = GetComponent<GhostSwitchManager> ();

		maincam = GameObject.FindGameObjectWithTag ("MainCamera");
		textBoxManager = FindObjectOfType < TextBoxManager >();

		player = GameObject.FindGameObjectWithTag ("Player");
		playerAnim = player.GetComponent<Animator>();
		playerController = player.GetComponent<Controller2> ();

		puppetMasterAnim = puppetMaster.GetComponent<Animator> ();
		puppetMasterFace("forward");
		puppetMaster.SetActive (false);
		isNameUpdated = false;

		humanAnim = human.GetComponent<Animator> ();
		humanController = human.GetComponent<Controller2> ();
		human.layer = 0;

		//TESTING
		//puppetMasterAnim.SetBool ("hasSoul", true);
		//StartCoroutine (temp ());
		//StartCoroutine (fifthTrigger ());
	}
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        //Import controller script
        Controller2 ControllerScript = GameObject.Find("background").GetComponent <Controller2>();

        //Button separation distances
        float xsep1 = 2f, xsep2 = 3.4f, xsep3 = 6.9f;
        float ysep1 = 3.3f * xsep1 / 5f;
        float ysep2 = 3.3f * xsep2 / 5f;

        //Make lists of positions of buttons
        List <Vector3> L1_Positions            = MakeL1Positions(xsep2, xsep3, ysep2);
        List <Vector3> L2_Positions            = MakeL2Positions(xsep2, xsep3, ysep2);
        List <Vector3> RelativeButtonPositions = MakeRelativePositions(xsep1, ysep1);

        //import various assignments from controller script
        List <List <int> > ColorAssignments = ControllerScript.ColorAssignments;
        List <int>         LeverAssignments = ControllerScript.LeverAssignments;

        L1_Buttons = new List <List <GameObject> > (8);
        L2_Buttons = new List <List <GameObject> > (8);


        RenderLights(ColorAssignments, L1_Positions, L2_Positions, RelativeButtonPositions, LeverAssignments);
    }
Exemplo n.º 5
0
    public void Attack(bool isEnemy)
    {
        if (CanAttack)
        {
            shootCooldown = shootingRate;

            // Create a new shot
            var shotTransform = Instantiate(shotPrefab) as Transform;

            // Assign position
            shotTransform.position = transform.position;

            // The is enemy property
            ShotScript shot = shotTransform.gameObject.GetComponent <ShotScript>();
            if (shot != null)
            {
                shot.isEnemyShot = isEnemy;
            }

            // Make the weapon shot always towards it
            MoveScript  move = shotTransform.gameObject.GetComponent <MoveScript>();
            Controller2 face = shotTransform.gameObject.GetComponent <Controller2>();
            if (move != null)
            {
                move.direction = this.transform.right;                 // towards in 2D space is the right of the sprite
            }
        }
    }
Exemplo n.º 6
0
    /// <summary>
    /// Awake()でコントローラーのインスタンス生成
    /// </summary>
    private void Awake()
    {
        if (!AllController)
        {
            AllController = gameObject.AddComponent <GamePadController>();
        }
        if (!Controller1)
        {
            Controller1 = gameObject.AddComponent <GamePadController>();
        }
        if (!Controller2)
        {
            Controller2 = gameObject.AddComponent <GamePadController>();
        }
        if (!Controller3)
        {
            Controller3 = gameObject.AddComponent <GamePadController>();
        }
        if (!Controller4)
        {
            Controller4 = gameObject.AddComponent <GamePadController>();
        }

        AllController.SetParameter(gamePad_dead);
        Controller1.SetParameter(gamePad_dead);
        Controller2.SetParameter(gamePad_dead);
        Controller3.SetParameter(gamePad_dead);
        Controller4.SetParameter(gamePad_dead);

        AllController.Controller = GamePad.Index.ALL;
        Controller1.Controller   = GamePad.Index.One;
        Controller2.Controller   = GamePad.Index.Two;
        Controller3.Controller   = GamePad.Index.Three;
        Controller4.Controller   = GamePad.Index.Four;
    }
Exemplo n.º 7
0
 void Start()
 {
     Controller2 = GameObject.Find("Controller2").GetComponent <Controller2>();
     isAttack    = false;
     enemy       = null;
     attackTime  = 0;
     isStart     = false;
 }
Exemplo n.º 8
0
 private void Start()
 {
     Controller2  = GameObject.Find("Controller2").GetComponent <Controller2>();
     isFix        = false;
     attackTarget = null;
     patrolTime   = 0;
     nextTime     = 0;
     isStart      = false;
 }
Exemplo n.º 9
0
    void OnTriggerEnter(Collider hit)
    {
        Controller2 player = hit.GetComponent <Controller2> ();

        if (player != null)
        {
            MyGameManager.TogglePromptText(true);
            MyGameManager.ToggleNarrationText(true);
        }
    }
 private void Estop()
 {
     if (Controller1 != null)
     {
         Controller1.Estop();
     }
     if (Controller2 != null)
     {
         Controller2.Estop();
     }
 }
Exemplo n.º 11
0
    //this is a tutotial script for level 1a
    void Start()
    {
        controller2 = GetComponent<Controller2>();
		textBoxManager = GameObject.FindObjectOfType<TextBoxManager> ();

		currentMessages = (Input.GetJoystickNames ().Length == 0) ? tutorialMessages : joyStickMessages;

		disableMessages (tutorialMessages);
		disableMessages (joyStickMessages);
		StartCoroutine ("ghostSwitchTutorial");
    }
Exemplo n.º 12
0
 private void Initialize(Controller2 parent, int childIndex)
 {
     mesh                    = parent.mesh;
     material                = parent.material;
     iteration               = parent.iteration;
     currentIteration        = parent.currentIteration + 1;
     childScale              = parent.childScale;
     transform.parent        = parent.transform;
     transform.localScale    = Vector3.one * childScale;
     transform.localPosition = childDirections[childIndex] * (0.5f + 0.5f * childScale);
     transform.localRotation = childOrientations[childIndex];
 }
Exemplo n.º 13
0
    void Start()
    {
        soundAudioSource = GameObject.Find("MainMenuCanvas").transform.Find("Sound").GetComponent <AudioSource>();

        Controller1       = GameObject.Find("Controller1").GetComponent <Controller1>();
        Controller2       = GameObject.Find("Controller2").GetComponent <Controller2>();
        goldNum           = GameObject.Find("MainMenuCanvas/BattleScene/HpGold/Gold").GetComponent <GoldNum>();
        goldNotEnoughText = GameObject.Find("MainMenuCanvas/BattleScene/GoldNumNotEnough").GetComponent <Text>();
        //初始攻击力
        attackPower = 2;
        hp          = 40;
        grade       = 1;
    }
    // Start is called before the first frame update
    void Start()
    {
        GUI.GetComponent <GUI>().ShowOverlays(false);
        UISprites = GUI.GetComponentsInChildren <Image>();
        GUI.GetComponent <GUI>().ShowOverlays(true);
        GUI.GetComponent <GUI>().SetOverlays();

        myController               = gameObject.GetComponent <Controller2>();
        actions                    = gameObject.GetComponent <Actions>();
        global                     = myController.global;
        cameraComponent            = myController.camera.GetComponent <Camera>();
        dynamicButtonUpdaterScript = gameObject.GetComponent <DynamicButtonUpdater>();
    }
Exemplo n.º 15
0
 protected async Task UserSection()
 {
     currentController = Controller2.getInstance(this);
     for (; ;)
     {
         currentController.action();
         while (changed)
         {
             changed = false;
             currentController.action();
         }
         await Wait();
     }
 }
Exemplo n.º 16
0
    protected override void Awake()
    {
        other_controller = GameObject.Find ("BlockController2").GetComponent<Controller2> ();
        gameBoard = GameObject.FindGameObjectWithTag ("Player1_GameBoard");

        spawner = FindObjectOfType<Spawner> ();

        nextBlockPosition = nextBlockText.transform.position + new Vector3(1.5f, -2, 0);

        for (int i = 0; i < 4; i++) {
            ghost [i] = (GameObject)Instantiate (ghostPrefab,
                                                 transform.position + new Vector3 (i, 10, 0),
                                                 Quaternion.identity);
        }

        blockGrid = new Grid (4, 20, 4);
    }
 private void motorBox2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (motorBox2.SelectedIndex != -1)
     {
         if (motorBox1.Text.Equals(motorBox2.Text))
         {
             MessageBox.Show("Motor is already in use");
             motorBox2.SelectedIndex = -1;
             motor2Desc.Clear();
         }
         else
         {
             DataTable table = Controller2.GetMotorInfo(motorBox2.Text);
             DataRow   row   = table.Rows[0];
             motor2Desc.Text = row["Description"].ToString();
         }
     }
 }
Exemplo n.º 18
0
    protected override void Awake()
    {
        other_controller = GameObject.Find("BlockController2").GetComponent <Controller2> ();
        gameBoard        = GameObject.FindGameObjectWithTag("Player1_GameBoard");

        spawner = FindObjectOfType <Spawner> ();

        nextBlockPosition = nextBlockText.transform.position + new Vector3(1.5f, -2, 0);

        for (int i = 0; i < 4; i++)
        {
            ghost [i] = (GameObject)Instantiate(ghostPrefab,
                                                transform.position + new Vector3(i, 10, 0),
                                                Quaternion.identity);
        }

        blockGrid = new Grid(4, 20, 4);
    }
Exemplo n.º 19
0
    void GenerateScene()
    {
        narrativeState++;
        curRoomCount = UnityEngine.Random.Range(roomNumMin, roomNumMax + 1);
        SetWorldState();
        MyGameRoom startRoom = baseRoomPool.SpawnFromPool(Vector3.zero);

        startRoom.Initialize(this);
        if (player == null)
        {
            player = Instantiate(playerPrefab, startRoom.transform.position + new Vector3(-10, 16, -30), Quaternion.identity) as Controller2;
        }
        else
        {
            player.transform.position = startRoom.transform.position + new Vector3(-10, 16, -30);
            player.transform.rotation = Quaternion.identity;
        }
    }
Exemplo n.º 20
0
        /// <summary>
        /// Triggers the platform haptic pulse.
        /// </summary>
        /// <param name="time">The duration of the pulse. 0 if nonstop.</param>
        /// <param name="controller">The controller to pulse.</param>
        public override void TriggerHapticPulse(float time, Controller controller)
        {
            // Find which controller to pulse.
            Controller controller1   = Controller1.GetComponent <Controller>();
            Controller controller2   = Controller2.GetComponent <Controller>();
            Hand       handToVibrate = null;

            if (controller1 != null)
            {
                // Find controller hand.
                if (controller1.Equals(controller))
                {
                    handToVibrate = controller1.gameObject.GetComponent <Hand>();
                }
            }
            else if (controller2 != null)
            {
                // Find controller hand.
                if (controller1.Equals(controller))
                {
                    handToVibrate = controller1.gameObject.GetComponent <Hand>();
                }
            }
            else
            {
                Debug.LogError("Could not vibrate the controller. Can't find controller scripts on the controllers.");
                return;
            }

            ushort timeInMs = Convert.ToUInt16(Mathf.Abs(time * 1000f));

            // Pulse.
            if (handToVibrate != null)
            {
                handToVibrate.controller.TriggerHapticPulse(timeInMs);
            }
            else
            {
                Debug.LogError("None of the controllers had a Controller script equal to the one received.");
            }
        }
        private void Motor2Start_Click(object sender, EventArgs e)
        {
            Controller2.ConnectMotor();

            String speedStr  = motor2Spd.Text;
            String accelStr  = motor2Accel.Text;
            String decelStr  = motor2Decel.Text;
            String countStr  = motor2Counts.Text;
            String degreeStr = Motor2Degrees.Text;

            int    Speed, Acceleration, Deceleration;
            double Counts, Degrees;

            int.TryParse(speedStr, out Speed);
            int.TryParse(accelStr, out Acceleration);
            int.TryParse(decelStr, out Deceleration);
            double.TryParse(countStr, out Counts);
            double.TryParse(degreeStr, out Degrees);

            Controller2.WriteMotor(Speed, Acceleration, Deceleration, Counts, Degrees);
        }
Exemplo n.º 22
0
    // Use this for initialization
    void Start()
    {
        //Import controller script
        Controller2 ControllerScript = GameObject.Find("background").GetComponent <Controller2>();

        LightAssignments = ControllerScript.LightAssignments;
        LeverAssignments = ControllerScript.LeverAssignments;

        L1_Buttons = GameObject.Find("Lights").GetComponent <MakeLights>().L1_Buttons;
        L2_Buttons = GameObject.Find("Lights").GetComponent <MakeLights>().L2_Buttons;

        QuitNow     = false;
        timeCounter = 0f;
        TimeToWait  = 10f;

        Win_Conditions_Fulfilled = new List <bool> (8);
        AllTrue = new List <bool> (8);
        for (int i = 0; i <= 7; i++)
        {
            Win_Conditions_Fulfilled.Add(false);
            AllTrue.Add(true);
        }
    }
 public void SetController(Controller2 controller) {
     Controller = controller;
 }
Exemplo n.º 24
0
    // Update is called once per frame
    public void Update()
    {
        if (pc.h.hitfreeze <= 0 && pc.moveTimer > 0)
        {
            pc.moveTimer -= Time.deltaTime;
        }
        ph = ch;
        ch = pc.cstate.fullPathHash;
        if (ch != ph || pplaytime > pc.cplaytime)
        {
            dms.resetDamage();
            resetHB();
        }

        if (pc.cstate.IsName("High Kick"))
        {
            if (pc.cplaytime >= .05 && pc.cplaytime < .5f)
            {
                tc[0].on = true;
            }
            else
            {
                resetTC();
            }
            if (pc.cplaytime > .3f && pc.cplaytime < .5f)
            {
                hb[0].active    = true;
                hb[0].type      = 2;
                hb[0].effect    = 0;
                hb[0].force     = forces[2];
                hb[0].damage    = damages[0];
                hb[0].stun      = stun[1];
                hb[0].proration = proration[2];
                hb[0].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("HK2"))
        {
            if (pc.cplaytime >= .05 && pc.cplaytime < .5f)
            {
                tc[1].on = true;
            }
            else
            {
                resetTC();
            }
            if (pc.cplaytime > .3f && pc.cplaytime < .5f)
            {
                hb[13].active    = true;
                hb[13].type      = 0;
                hb[13].effect    = 0;
                hb[13].force     = forces[2];
                hb[13].damage    = damages[0];
                hb[13].stun      = stun[1];
                hb[13].proration = proration[2];
                hb[13].hitfreeze = .075f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("HK3"))
        {
            if (pc.cplaytime >= .05 && pc.cplaytime < .5f)
            {
                tc[0].on = true;
            }
            else
            {
                resetTC();
            }
            if (pc.cplaytime > .3f && pc.cplaytime < .5f)
            {
                hb[13].active    = true;
                hb[13].type      = 0;
                hb[13].effect    = 0;
                hb[13].force     = forces[2];
                hb[13].damage    = damages[0];
                hb[13].stun      = stun[1];
                hb[13].proration = proration[2];
                hb[13].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("HK4"))
        {
            if (pc.cplaytime >= .05 && pc.cplaytime < .5f)
            {
                tc[1].on = true;
            }
            else
            {
                resetTC();
            }
            if (pc.cplaytime > .3f && pc.cplaytime < .5f)
            {
                hb[14].active    = true;
                hb[14].type      = 2;
                hb[14].effect    = 0;
                hb[14].force     = forces[3];
                hb[14].damage    = damages[0];
                hb[14].stun      = stun[1];
                hb[14].proration = proration[2];
                hb[14].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Split Kick"))
        {
            hb[12].active    = true;
            hb[12].type      = 2;
            hb[12].effect    = 0;
            hb[12].force     = forces[0];
            hb[12].damage    = damages[0];
            hb[12].stun      = stun[0];
            hb[12].proration = proration[2];
            hb[12].hitfreeze = .05f;
        }
        else if (pc.cstate.IsName("Low Kick"))
        {
            if (pc.cplaytime >= .3 && pc.cplaytime < .5f)
            {
                tc[1].on = true;
            }
            else
            {
                resetTC();
            }
            if (!pc.tchange && pc.cplaytime > .3f && pc.cplaytime < .6f)
            {
                hb[7].active    = true;
                hb[7].type      = 0;
                hb[7].effect    = 0;
                hb[7].force     = forces[0];
                hb[7].damage    = damages[0];
                hb[7].stun      = stun[0];
                hb[7].proration = proration[2];
                hb[7].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Air Spin"))
        {
            //todo: air spin
            if (pc.cplaytime >= .1 && pc.cplaytime < .7f)
            {
                tc[0].on = true;
                tc[1].on = true;
            }
            else
            {
                resetTC();
            }
            if (!pc.tchange && pc.cplaytime > .3f && pc.cplaytime < .6f)
            {
                hb[7].active              = true;
                hb[7].type                = 0;
                hb[7].effect              = 0;
                hb[7].force               = forces[4] * 1.1f;
                hb[7].damage              = damages[0];
                hb[7].stun                = stun[0];
                hb[7].proration           = proration[2];
                hb[7].hitfreeze           = .07f;
                hb[7].antigravity         = .5f * pc.gravity;
                hb[7].antigravityDuration = .1f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Air Spin Heavy"))
        {
            if (pc.cplaytime >= .1 && pc.cplaytime < .7f)
            {
                tc[0].on = true;
                tc[1].on = true;
            }
            else
            {
                resetTC();
            }
            if ((!pc.tchange && pc.cplaytime > .23f && pc.cplaytime < .32f) || (pplaytime <= .23f && pc.cplaytime >= .32f))
            {
                hb[7].active              = true;
                hb[7].type                = 0;
                hb[7].effect              = 0;
                hb[7].force               = forces[4];
                hb[7].damage              = damages[0];
                hb[7].stun                = stun[0];
                hb[7].proration           = proration[2];
                hb[7].hitfreeze           = .07f;
                hb[7].antigravity         = .125f * pc.gravity;
                hb[7].antigravityDuration = .1f;
            }
            else if ((!pc.tchange && pc.cplaytime > .4f && pc.cplaytime < .5f) || (pplaytime <= .4f && pc.cplaytime >= .5f))
            {
                hb[7].active              = true;
                hb[7].type                = 0;
                hb[7].effect              = 0;
                hb[7].force               = forces[7];
                hb[7].damage              = damages[0];
                hb[7].stun                = stun[0];
                hb[7].proration           = proration[2];
                hb[7].hitfreeze           = .07f;
                hb[7].antigravity         = .125f * pc.gravity;
                hb[7].antigravityDuration = .1f;
            }
            else if (!pc.tchange && pc.cplaytime > .6f && pc.cplaytime < .8f)
            {
                hb[7].active              = true;
                hb[7].type                = 0;
                hb[7].effect              = 0;
                hb[7].force               = forces[7];
                hb[7].damage              = damages[0];
                hb[7].stun                = stun[0];
                hb[7].proration           = proration[2];
                hb[7].hitfreeze           = .07f;
                hb[7].antigravity         = .125f * pc.gravity;
                hb[7].antigravityDuration = .1f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Air Spin Enhanced"))
        {
            if (pc.cplaytime >= .1 && pc.cplaytime < .5f)
            {
                tc[0].on = true;
                tc[1].on = true;
            }
            else if (pc.cplaytime > .6)
            {
                tc[0].on = true;
            }
            else
            {
                resetTC();
            }
            if (!pc.tchange && pc.cplaytime > .29f && pc.cplaytime < .43f)
            {
                hb[7].active              = true;
                hb[7].type                = 0;
                hb[7].effect              = 0;
                hb[7].force               = forces[4] * 1.25f;
                hb[7].damage              = damages[0];
                hb[7].stun                = stun[0];
                hb[7].proration           = proration[2];
                hb[7].hitfreeze           = .07f;
                hb[7].antigravity         = .5f * pc.gravity;
                hb[7].antigravityDuration = .1f;
            }
            else if (!pc.tchange && pc.cplaytime > .68f && pc.cplaytime < .9f)
            {
                hb[7].active              = true;
                hb[7].type                = 0;
                hb[7].effect              = 0;
                hb[7].force               = forces[6];
                hb[7].damage              = damages[2];
                hb[7].stun                = stun[0];
                hb[7].proration           = proration[2];
                hb[7].hitfreeze           = .07f;
                hb[7].antigravity         = .375f * pc.gravity;
                hb[7].antigravityDuration = .4f;
                hb[7].launch              = 12f * pc.gravity;
                hb[7].launchDuration      = .7f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("High Punch"))
        {
            if (!pc.tchange && pc.cplaytime > .17f && pc.cplaytime < .40f)
            {
                hb[1].active    = true;
                hb[1].type      = 0;
                hb[1].effect    = 0;
                hb[1].force     = forces[0];
                hb[1].damage    = damages[0];
                hb[1].stun      = stun[0];
                hb[1].proration = proration[0];
                hb[1].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Special 1"))
        {
            if (pc.cplaytime < .5f)
            {
                tc[0].on = true;
                tc[1].on = true;
            }
            else if (pc.cplaytime > .55 && pc.cplaytime < .68f)
            {
                tc[1].on = true;
            }
            else
            {
                resetTC();
            }
            float mpercent = 1 - (pc.moveTimer / pc.h.ms.GetTempestFD("Special 1"));
            if (mpercent > .22f && mpercent < .3f)
            {
                hb[11].active    = true;
                hb[11].type      = 0;
                hb[11].effect    = 0;
                hb[11].force     = forces[0];
                hb[11].damage    = damages[0];
                hb[11].stun      = stun[0];
                hb[11].proration = proration[2];
                hb[11].hitfreeze = .025f;
            }
            else if (mpercent > .41f && mpercent < .48f)
            {
                hb[11].active    = true;
                hb[11].type      = 0;
                hb[11].effect    = 0;
                hb[11].force     = forces[0];
                hb[11].damage    = damages[0];
                hb[11].stun      = stun[0];
                hb[11].proration = proration[2];
                hb[11].hitfreeze = .025f;
            }
            else if (mpercent > .6f && mpercent < .7f)
            {
                hb[11].active    = true;
                hb[11].type      = 2;
                hb[11].effect    = 0;
                hb[11].force     = forces[3];
                hb[11].damage    = damages[0];
                hb[11].stun      = stun[1];
                hb[11].proration = proration[2];
                //hb[11].knockdown = true;
                hb[11].hitfreeze = .025f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Low Punch") || pc.cstate.IsName("Low Punch 2") || pc.cstate.IsName("Low Punch 3"))
        {
            if (!pc.tchange && pc.cplaytime > .4f && pc.cplaytime < .60f)
            {
                hb[3].active    = true;
                hb[3].type      = 0;
                hb[3].effect    = 0;
                hb[3].force     = forces[0];
                hb[3].damage    = damages[0];
                hb[3].stun      = stun[1];
                hb[3].proration = proration[2];
                hb[3].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Low Punch 4"))
        {
            //todo:low punch 4
            if (!pc.tchange && pc.cplaytime > .4f && pc.cplaytime < .60f)
            {
                hb[3].active              = true;
                hb[3].type                = 0;
                hb[3].effect              = 0;
                hb[3].force               = forces[4] * 1.1f;
                hb[3].damage              = damages[0];
                hb[3].stun                = stun[0];
                hb[3].proration           = proration[2];
                hb[3].hitfreeze           = .07f;
                hb[3].antigravity         = .5f * pc.gravity;
                hb[3].antigravityDuration = .1f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Crouch Low Punch"))
        {
            if (!pc.tchange && pc.cplaytime > .4f && pc.cplaytime < .60f)
            {
                hb[4].active    = true;
                hb[4].type      = 1;
                hb[4].effect    = 0;
                hb[4].force     = forces[0];
                hb[4].damage    = damages[0];
                hb[4].stun      = stun[0];
                hb[4].proration = proration[2];
                hb[4].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Crouch High Punch"))
        {
            if (!pc.tchange && pc.cplaytime > .2f && pc.cplaytime < .40f)
            {
                hb[5].active    = true;
                hb[5].type      = 2;
                hb[5].effect    = 0;
                hb[5].force     = forces[0];
                hb[5].damage    = damages[0];
                hb[5].stun      = stun[0];
                hb[5].proration = proration[2];
                hb[5].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Crouch High Kick"))
        {
            if (!pc.tchange && pc.cplaytime > .52f && pc.cplaytime < .65f)
            {
                hb[9].active    = true;
                hb[9].type      = 0;
                hb[9].effect    = 0;
                hb[9].force     = forces[0];
                hb[9].damage    = damages[0];
                hb[9].stun      = stun[0];
                hb[9].proration = proration[2];
                hb[9].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Air High Punch"))
        {
            if (!pc.tchange && pc.cplaytime > .35f && pc.cplaytime < .60f)
            {
                hb[8].active    = true;
                hb[8].type      = 2;
                hb[8].effect    = 0;
                hb[8].force     = forces[0];
                hb[8].damage    = damages[0];
                hb[8].stun      = stun[0];
                hb[8].proration = proration[2];
                hb[8].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Air Low Punch"))
        {
            if (!pc.tchange && pc.cplaytime > .45f && pc.cplaytime < .75f)
            {
                hb[10].active    = true;
                hb[10].type      = 2;
                hb[10].effect    = 0;
                hb[10].force     = forces[0];
                hb[10].damage    = damages[0];
                hb[10].stun      = stun[0];
                hb[10].proration = proration[2];
                hb[10].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Crouch Low Kick"))
        {
            if (!pc.tchange && pc.cplaytime > .2f && pc.cplaytime < .40f)
            {
                hb[6].active    = true;
                hb[6].type      = 1;
                hb[6].effect    = 0;
                hb[6].force     = forces[0];
                hb[6].damage    = damages[1];
                hb[6].stun      = stun[0];
                hb[6].proration = proration[2];
                hb[6].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Slide"))
        {
            if (!pc.tchange && pc.cplaytime > .1f && pc.cplaytime < .95f)
            {
                hb[6].active    = true;
                hb[6].type      = 1;
                hb[6].effect    = 0;
                hb[6].force     = forces[0];
                hb[6].damage    = damages[0];
                hb[6].stun      = stun[0];
                hb[6].proration = proration[2];
                hb[6].hitfreeze = .05f;

                Controller2 pc2 = pc.GetComponent <Controller2>();
                if (pc2.b_poweredup == true)
                {
                    hb[6].damage    = damages[0] * 4;
                    hb[6].knockdown = true;
                    hb[6].hitfreeze = .1f;
                }
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Air Low Kick"))
        {
            if (pc.cplaytime >= .1f && pc.cplaytime < .6f)
            {
                hb[2].active    = true;
                hb[2].type      = 2;
                hb[2].effect    = 0;
                hb[2].force     = forces[0];
                hb[2].damage    = damages[0];
                hb[2].stun      = stun[2];
                hb[2].proration = proration[0];
                hb[2].hitfreeze = .05f;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else if (pc.cstate.IsName("Grab"))
        {
            if (pc.cplaytime >= .1f && pc.cplaytime < .6f)
            {
                hb[15].active = true;
                hb[15].type   = 3;
                hb[15].damage = 0;
            }
            else
            {
                resetHB();
                dms.resetDamage();
            }
        }
        else
        {
            resetHB();
            resetTC();
        }
        pplaytime = pc.cplaytime;
    }
Exemplo n.º 25
0
 public Bot(DaveBot_1_4_5_Interface controller) {
     this.controller = controller;
 }
Exemplo n.º 26
0
 // Use this for initialization
 void Start()
 {
     player = FindObjectOfType<Controller2> ();
 }
Exemplo n.º 27
0
 void Start()
 {
     life     = GetComponentInParent <Controller2> ();
     player_2 = GetComponent <Animator>();
 }
Exemplo n.º 28
0
 void GenerateScene()
 {
     narrativeState++;
     curRoomCount = UnityEngine.Random.Range (roomNumMin, roomNumMax + 1);
     SetWorldState ();
     MyGameRoom startRoom = baseRoomPool.SpawnFromPool (Vector3.zero);
     startRoom.Initialize (this);
     if (player == null) {
         player = Instantiate (playerPrefab, startRoom.transform.position + new Vector3 (-10, 16, -30), Quaternion.identity) as Controller2;
     } else {
         player.transform.position = startRoom.transform.position + new Vector3 (-10, 16, -30);
         player.transform.rotation = Quaternion.identity;
     }
 }
        public void NoProxyRequired() {
            var view = new ViewRequiringController2();
            var controller = new Controller2();

            Assert.IsNull(view.Controller);
            UipUtil.SetController(view, controller, false);
            Assert.AreSame(controller, view.Controller);

            Assert.IsFalse(controller.DidSomething);
            view.DoSomething();
            Assert.IsTrue(controller.DidSomething);
        }
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if ((Controller1 != null && Controller1.TimerIsRunning()) || (Controller2 != null && Controller2.TimerIsRunning()))
     {
         DialogResult answer = MessageBox.Show("The motor is running. Closing this form will stop the cue.", "Are you sure?",
                                               MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
         if (answer != DialogResult.OK)
         {
             e.Cancel       = true;
             FormToOpenNext = null;
         }
         else
         {
             Estop();
         }
     }
 }