Inheritance: MonoBehaviour
 //public InteractableSpeechBubble speech;
 // Use this for initialization
 void Start()
 {
     _uiControl = GameObject.FindGameObjectWithTag(Constants.Tags.GameUI).GetComponent<UiController>();
     _sideKickAgent = GameObject.FindGameObjectWithTag(Constants.Tags.SideKick).GetComponent<NavMeshAgent>();
     //_playerMovement = GameObject.FindGameObjectWithTag(Constants.Tags.Player).GetComponent<AiMovement>();
     _player = GameObject.FindGameObjectWithTag(Constants.Tags.Player).GetComponent<NavMeshAgent>();
 }
Beispiel #2
0
    public static UiController getInstance()
    {
        if (_instance != null)
        {
            _instance = new UiController();
        }

        return _instance;
    }
Beispiel #3
0
 void Awake()
 {
     if (_instance == null) {
         _instance = this;
         init();
     } else {
         Destroy (this);
     }
 }
Beispiel #4
0
	// Use this for initialization
	void Start () {
		UI = GameObject.FindGameObjectWithTag ("UI");
		uiControllerScript = UI.GetComponent<UiController> ();
	}
Beispiel #5
0
 private void Awake()
 {
     ui             = GetComponent <UiController>();
     Time.timeScale = 1;
 }
 void Awake()
 {
     instance = this;
     UpdateTime(1, 0);
 }
Beispiel #7
0
 void Start()
 {
     _uiController = GameObject.FindObjectOfType <UiController>();
     _renderer     = GetComponent <SpriteRenderer>();
 }
Beispiel #8
0
    void Awake()
    {
        loadPoolObject();
        loadprivateObject();

        Life = 4;
        Charge = 0;
        //CoinsCollected = 0;
        _coinsCollected = 0;

        self = this;
        print(self);
    }
 void Awake()
 {
     ui = FindObjectOfType <UiController>();
     gc = FindObjectOfType <GameController>();
 }
Beispiel #10
0
    public void PioggiaDiFrecce(GameObject _enemy)
    {
        BattleGrid   grid = FindObjectOfType <BattleGrid>();
        UiController ui   = FindObjectOfType <UiController>();
        // Suono
        AudioSource audio = GameObject.Find("SoundManager").GetComponent <AudioSource>();

        audio.PlayOneShot(audioFreccia);
        //costo e variabili
        int mp    = costoAbilita[4];
        int danni = Mathf.RoundToInt(((player.stats.attDistanza) * 63) / 100);
        List <GameObject> targets = new List <GameObject>();
        // cerca i target

        Enemy    ene  = _enemy.GetComponent <Enemy>();
        Animator anim = player.GetComponent <Animator>();

        if (ene.pos.x >= player.pos.x)
        {
            anim.SetTrigger("AttackRight");
        }
        else
        {
            anim.SetTrigger("AttackLeft");
        }
        int _x = (int)ene.pos.x;
        int _y = (int)ene.pos.y;



        for (int i = (_x - 3); i <= (_x + 3); i++)
        {
            for (int y = (_y - 3); y <= (_y + 3); y++)
            {
                if (i < 0)
                {
                    continue;
                }
                if (y < 0)
                {
                    continue;
                }
                if (i > grid.width - 1)
                {
                    continue;
                }
                if (y > grid.height - 1)
                {
                    continue;
                }

                if (Mathf.Abs(i - _x) + Mathf.Abs(y - _y) <= (3))
                {
                    if (grid.cells[i, y].occupier != null)
                    {
                        targets.Add(grid.cells[i, y].occupier);
                    }
                }
            }
        }

        foreach (GameObject item in targets)
        {
            GameObject effect = Instantiate(frecciaSprite);
            effect.transform.position = item.transform.position;

            if (item.GetComponent <Enemy>() != null)
            {
                Enemy enemy1 = item.GetComponent <Enemy>();
                enemy1.SubisciDannoRanged(danni, item);
            }
            else
            {
                Player player1 = item.GetComponent <Player>();
                player1.SubisciDanno(danni);
            }
        }

        Enemy enemy = _enemy.GetComponent <Enemy>();

        //scala il danno dal nemico e gli mp al player
        player.stats.mp -= mp;
        // Roba UI
        ui.AggiornaMana(player.stats.mpMax, player.stats.mp, player.uiInfo);
        GameObject[] targetss = GameObject.FindGameObjectsWithTag("Target");
        foreach (var item in targetss)
        {
            Destroy(item);
        }
        DestroyAttackBox();
        DestroyEnemyButton();
    }
 void Start()
 {
     signalRController = GameObject.Find("SignalRController").GetComponent <SignalRController>();
     uiController      = GameObject.Find("Controller_Menu").GetComponent <UiController>();
 }
Beispiel #12
0
 private void Awake()
 {
     Instance         = this;
     CurrentDataStack = new Stack <string>();
     TcpServerConnection.MessageRecieved += CheckData;
 }
Beispiel #13
0
        public static object GetFieldValue(UiController controller, object binding, object definition, InvokeParameters invokeParameters)
        {
            FieldName field = (FieldName)definition;

            object context = field.Binding ? binding : controller;

            if (field.Name == "*")
            {
                return(context);
            }

            string name = field.Name;

            if (name.StartsWith(":"))
            {
                name       = name.Substring(1);
                controller = controller.Parent;
            }

            int[] indices = null;

            if (field.Parameters != null)
            {
                indices = new int[field.Parameters.Length];

                for (int idx = 0; idx < indices.Length; ++idx)
                {
                    indices[idx] = (int)ObtainParameter(invokeParameters, field.Parameters[idx]);
                }
            }

            PropertyInfo info = context.GetType().GetProperty(name);

            if (info != null)
            {
                object value = info.GetValue(context, null);

                if (indices != null)
                {
                    if (value is Array)
                    {
                        return((value as Array).GetValue(indices));
                    }

                    throw new Exception(string.Format("Value is not an array: {0}[{1}]", name, indices.ToString()));
                }
                else
                {
                    return(value);
                }
            }
            else
            {
                FieldInfo finfo = context.GetType().GetField(name);

                if (finfo != null)
                {
                    object value = finfo.GetValue(context);

                    if (indices != null)
                    {
                        if (value is Array)
                        {
                            return((value as Array).GetValue(indices));
                        }

                        throw new Exception(string.Format("Value is not an array: {0}[{1}]", name, indices.ToString()));
                    }
                    else
                    {
                        return(value);
                    }
                }
            }

            throw new Exception(string.Format("Cannot find field: {0}{1}", field.Name, indices != null ? '[' + indices.ToString() + ']' : ""));
        }
Beispiel #14
0
        public static T InvokeMethod <T>(UiController controller, object binding, object definition, InvokeParameters invokeParameters)
        {
            object result = InvokeMethod(controller, binding, definition, invokeParameters);

            return((T)Convert.ChangeType(result, typeof(T)));
        }
Beispiel #15
0
 void Start()
 {
     world = gameObject.GetComponent <World>();
     ui    = gameObject.GetComponent <UiController>();
 }
Beispiel #16
0
            public void tick()
            {
                switch(state) {
                    case GameController.State.Loading:
                        rpgBackbuffer = cabedge.NewImage(320, 240);
                        uiController = new UiController();
                        rpgController = new RpgController(cabedge.player1);

                        //rpgController.SwitchMap("raw/dock.map");
                        rpgController.SwitchMap("raw/city01.map");
                        rpgController.CreatePlayer("raw/man4.chr", 7, 15);
                        man = rpgController.CreateEntity("raw/man3.chr", 8, 11);
                        man.bCanHurry = false;
                        man.activationScript = "Test1";
                        cabedge.loading();

                        state = State.InGame;
                        goto case GameController.State.InGame;

                    case State.MainMenu:
                        goto case State.InGame;

                    case State.InGame:
                        rpgController.tick();
                        uiController.tick();
                        /*if(player1.Confirm) {
                            player1.Confirm.unpress();
                            uiController.textOpen();
                        }*/
                        break;
                }
            }
Beispiel #17
0
 //private UiController _uiControl;
 void Start()
 {
     _uiControl = GameObject.FindGameObjectWithTag(Constants.Tags.GameUI).GetComponent<UiController>();
     databaseManager = GameObject.FindGameObjectWithTag(Constants.Tags.DatabaseManager).GetComponent<DatabaseManager>();
 }
 private void Awake()
 {
     m_uiController = GetComponent <UiController>();
 }
    void Start()
    {
        databaseManager = GameObject.FindGameObjectWithTag(Constants.Tags.DatabaseManager);

        audioManager = GameObject.FindGameObjectWithTag(Constants.Tags.AudioManager).GetComponent<AudioManager>();
        _UiController = GameObject.FindObjectOfType<UiController> ().GetComponent<UiController>();

        image = GetComponent<Image>();
    }
Beispiel #20
0
 bool IDefinitionClass.Init(UiController controller, object binding, DefinitionFile file)
 {
     Init(controller, binding, file);
     return(true);
 }
Beispiel #21
0
 void Awake()
 {
     _instance = this;
 }
Beispiel #22
0
 protected virtual void Init(UiController controller, object binding, DefinitionFile definition)
 {
 }
 void UpdateUi()
 {
     UiController.TriggerScoreEvent(currentScore);
     UiController.TriggerDistanceEvent(currentDistance);
 }
Beispiel #24
0
    void Start()
    {
        _camera = Camera.main.GetComponent<CameraController>();
        _ui = GetComponent<UiController>();

        StartStage();

        return;

        if (Door.doors.ContainsKey("MainDoor")) {
            _camera.target = Door.doors["MainDoor"].transform;
            _player.transform.position = Door.doors["MainDoor"].transform.position;
            (_player.GetComponent<Renderer>() as SpriteRenderer).color = Color.clear;
        }
    }