Example #1
0
    // Use this for initialization
    void Start()
    {
        attacking = false;
        shooting  = false;
        staggered = false;

        speedMod = 1;

        animator   = GetComponent <Animator>();
        body2d     = GetComponent <Rigidbody2D>();
        box2d      = GetComponent <BoxCollider2D>();
        edge2d     = GetComponent <EdgeCollider2D>();
        health     = maxHealth;
        attackMove = 1;

        speed      = baseSpeed;
        speedLevel = 0;

        //currentAnim = "No Animation";

        if (UnityService == null)
        {
            UnityService = new UnityService();
        }
    }
Example #2
0
 private void Start()
 {
     _rb = GetComponent <Rigidbody>();
     if (service == null)
     {
         service = this.gameObject.AddComponent <UnityMoveService>();
     }
 }
Example #3
0
 void Start( )
 {
     animator    = GetComponent <Animator>();
     myRigidBody = GetComponent <Rigidbody2D>();
     movement    = new Movement(speed);
     if (unityService == null)
     {
         unityService = new UnityService();
     }
 }
Example #4
0
    // Start is called before the first frame update
    void Start()
    {
        controller = GetComponent <Controller2D>();
        //movement = new Movement();

        if (UnityService == null)
        {
            UnityService = new UnityService();
        }
    }
Example #5
0
        void Start()
        {
            movement = new Movement(speed);


            if (unityService == null)
            {
                unityService = new UnityService();
            }
        }
    public void Start()
    {
        UnityService = new UnityService();

        Controls.Player.PlayerLeftHandUse.performed += (ctx) => SetUsingLeftHand();
        Controls.Player.PlayerLeftHandUse.canceled  += (ctx) => UnsetUsingLeftHand();

        Controls.Player.PlayerRightHandUse.performed += (ctx) => SetUsingRightHand();
        Controls.Player.PlayerRightHandUse.canceled  += (ctx) => UnsetUsingRightHand();
    }
Example #7
0
        protected virtual void Start()
        {
            if (_unityService == null)
            {
                _unityService = new UnityService();
            }

            _boxCollider     = GetComponent <BoxCollider2D>();
            _rb2D            = GetComponent <Rigidbody2D>();
            _inverseMoveTime = 1f / moveTime;
        }
        public void Setup()
        {
            cube = new GameObject().AddComponent <MoveController>();
            cube.gameObject.AddComponent <Rigidbody>();
            cube.speed = 1f;

            service = Substitute.For <IUnityService>();
            service.GetDeltaTime().Returns(0.3f);
            life.life      = 100;
            cube.lifeGauge = life;
        }
Example #9
0
    public Enemy(float health, IGun gun, IUnityService unityService = null)
    {
        m_health = health;
        m_gun    = gun;

        m_unityService = unityService;
        if (m_unityService == null)
        {
            m_unityService = new UnityService();
        }
    }
Example #10
0
    // Start is called before the first frame update
    void Start()
    {
        if (_movement == null)
        {
            _movement = new Movement(Speed);
        }

        if (_unityService == null)
        {
            _unityService = new UnityService();
        }
    }
Example #11
0
        // Use this for initialization
        void Start()
        {
            //_weapon.Charge();

            movement = new Movement(speed);


            if (unityService == null)
            {
                unityService = new UnityService();
            }

            //if (soundManager == null)
            //    soundManager = new SoundManager();
        }
Example #12
0
 void Awake()
 {
     Destroy(GameObject.FindGameObjectWithTag("Music"));
     Cursor.visible = false;
     audioSource    = GetComponent <AudioSource>();
     pauseScreen.SetActive(false);
     lossScreen.SetActive(false);
     winScreen.SetActive(false);         //sets all the different in game menus inactive
     scene = SceneManager.GetActiveScene();
     ResourcesScript.level = scene.name; // load scene
     if (UnityService == null)
     {
         UnityService = new UnityService(); //create an instance of the interface
     }
 }
Example #13
0
        public void TestSetUp()
        {
            life         = new GameObject().AddComponent <LifeGauge>();
            life.lifebar = new GameObject().AddComponent <Slider>();
            life.loose   = new GameObject().AddComponent <Text>();
            life.life    = 100;

            moveController = new GameObject().AddComponent <MoveController>();
            moveController.gameObject.AddComponent <Rigidbody>();
            moveController.transform.position = Vector3.one;
            moveController.lifeGauge          = life;

            camera = new GameObject().AddComponent <CameraController>();
            camera.transform.position = new Vector3(3, 3, 3);
            camera.target             = moveController.transform;

            service = Substitute.For <IUnityService>();
            service.GetDeltaTime().Returns(0.5f);
        }
 // Start is called before the first frame update
 void Start()
 {
     l                   = new LightFunctions();
     l.floorBound        = floor.transform.position.y;
     l.ceilingBound      = ceiling.transform.position.y;
     l.leftBound         = wall_Left.transform.position.x;
     l.rightBound        = wall_Right.transform.position.x;
     l.backBound         = wall_Back.transform.position.z;
     l.frontBound        = wall_Front.transform.position.z;
     l.mainLight         = mainLight;
     l.MAX_INTENSITY     = MAX_INTENSITY;
     l.MIN_INTENSITY     = MIN_INTENSITY;
     l.lightInitPosition = l.mainLight.transform.position;
     l.lightInitType     = l.mainLight.type;
     if (UnityService == null)
     {
         UnityService = new UnityService();
     }
 }
Example #15
0
 public InputController_Standalone(IUnityService unityService) : base(unityService)
 {
 }
Example #16
0
 public InputController_Mobile(IUnityService service) : base(service)
 {
 }
 public TestController(IT_InputVGMService inputVGMService, IUnityService unity)
 {
     t_InputVGMService = inputVGMService;
     this.unity        = unity;
 }
Example #18
0
 public void Construct(IPlayerCommandRecorder playerCommandRecorder, IUnityService unityService)
 {
     this.playerCommandRecorder = playerCommandRecorder;
     this.unityService          = unityService;
 }
Example #19
0
 public InputContoller(IUnityService unityService)
 {
     _unityService = unityService;
 }