Example #1
0
    bool isStartAct = false;            // 行動開始するか

    // Use this for initialization
    void Start()
    {
        // 他のクラスでも使う関数を切り出した
        //generalFunc = new GeneralFunc ();

        // 左右の向きを親クラスから取得
        moveX  = this.GetComponentInParent <MoveX>();
        isLeft = moveX.GetIsLeft();

        // コピー用銛をDeactiveに
        boatSpear.SetActive(false);

        // 一斉攻撃のタイミング取得用
        // BoatManagerはGameController経由で取得
        gameControllerObj = GameObject.FindWithTag("GameController");
        gameCtrl          = gameControllerObj.GetComponent <GameController>();
        boatManager       = gameCtrl.GetBoatManager();


        // 設定値取得等の初期設定
        InitSetting();

        // ダメージの確認用
        boatDamage = this.GetComponent <BoatDamage> ();

        // 銛関係のマネージャ
        GameObject   obj           = new GameObject("SpearManger");
        SpearManager smAddComponet = obj.AddComponent <SpearManager> ();

        spearManager = smAddComponet;
    }
Example #2
0
 // Start is called before the first frame update
 public void Init(Team team)
 {
     this.id   = BoatManager.getNextId();
     this.team = team;
     this.LoadBoatEntities();
     this.rigid = this.GetComponent <Rigidbody2D>();
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        // 漁船関係をまとめたオブジェクトを作成
        GameObject  obj           = new GameObject("BoatManager");
        BoatManager bmAddComponet = obj.AddComponent <BoatManager> ();

        boatManager = bmAddComponet;
        boatManager.Init(
            createMinX,
            createMaxX,
            createMinY,
            createMaxY,
            japBoats
            );

        // 漁船のコピー元Objをdeactive
        for (int i = 0; i < japBoats.Length; i++)
        {
            japBoats[i].SetActive(false);
        }

        // ゲームオーバー用にイルカの生存フラグをみる
        GameObject dolpObj = GameObject.FindWithTag("Player");

        dolphinCtrl = dolpObj.GetComponent <DolphinController>();

        IsGameOver   = false;
        HasPushRetry = false;
    }
Example #4
0
    // Use this for initialization
    void Start()
    {
        _hungryNum = Random.value * 0.6f + 0.4f;

        _boatMgr = FindObjectOfType <BoatManager>();
        anim     = GetComponent <Animator>();
    }
Example #5
0
 void GameEnd()
 {
     // 終了時
     if (GameTime >= 120 || getBoatAlive() == 0)
     {
         BoatManager boats = GetComponent <BoatManager> ();
         boats.enabled = false;
     }
 }
Example #6
0
    // Use this for initialization
    //new void Awake () {
    //       base.Awake();
    //       boatManager = boat.GetComponent<BoatManager>();
    //       //float posX = transform.position.x * (boat.position.x + Random.Range(0, 5));
    //       //float posY = transform.position.y + Random.Range(3, 7 + 2);       //TODO no magic number!!
    //       //transform.position = new Vector2(posX, posY);
    //       manualInput = ManualInputs.instance;
    //       arduino = manualInput.arduinos[arduinoNum];
    //   }

    new void Start()
    {
        base.Start();
        boatManager = boat.GetComponent <BoatManager>();
        //float posX = transform.position.x * (boat.position.x + Random.Range(0, 5));
        //float posY = transform.position.y + Random.Range(3, 7 + 2);       //TODO no magic number!!
        //transform.position = new Vector2(posX, posY);
        manualInput = ManualInputs.instance;
        arduino     = manualInput.arduinos[arduinoNum];
    }
Example #7
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Example #8
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Debug.Log("Instance already exists, destroying object!");
         Destroy(this);
     }
 }
Example #9
0
    // Use this for initialization
    //new void Start () {
    //       base.Start();
    //       boatManager = boat.GetComponent<BoatManager>();
    //       manualInput = ManualInputs.instance;
    //       arduinoOutput = manualInput.arduinos[arduinoOutputNum];
    //   }

    void OnEnable()
    {
        if (boatManager == null)
        {
            base.Start();
            boatManager   = boat.GetComponent <BoatManager>();
            manualInput   = ManualInputs.instance;
            arduinoOutput = manualInput.arduinos[arduinoOutputNum];
        }

        StartCoroutine("startSound");
        toggleLED();
        isLeaking = true;
        Debug.Log("Leak enabled: " + gameObject.name);
    }
Example #10
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Debug.Log("Instance already exists, destroying object!");
            Destroy(this);
        }

        foreach (BoatEntity boatEntity in BoatEntities)
        {
            BoatEntityByType[boatEntity.BoatEntityType] = boatEntity;
        }
    }
Example #11
0
    public void GameEnd()
    {
        _boatMgr = FindObjectOfType <BoatManager>();


        float totalPoint = 0;

        for (int i = 0; i < _boatMgr.BoatArray.Length; i++)
        {
            totalPoint += _boatMgr.BoatArray[i].Count;
        }

        _score.treasurePoint = totalPoint;
        _score.aliveBoat     = _boatMgr.getBoatAlive();


        FindObjectOfType <FadeCtrl.FadeController>().StartFadeOut("Result");
        //SceneManager.LoadScene("Result");
    }
Example #12
0
        public frmConfirmBoatRental(Boat boat, User user, BoatManager boatManager)
        {
            InitializeComponent();
            // if the user has no permission, close the form
            var hasPermission = false;

            foreach (var role in user.Roles)
            {
                if (role.RoleName == "Rental")
                {
                    hasPermission = true;
                    break;
                }
            }
            if (hasPermission == false)
            {
                this.Close();
            }
            _boat        = boat;
            _boatManager = boatManager;
        }
Example #13
0
    public void StartGame()
    {
        Vector3 position = Vector3.zero;

        foreach (Team team in instance.Teams.Values)
        {
            Boat boat = BoatManager.instance.SpawnBoat(team, position, Quaternion.identity);
            position.y += 3;

            foreach (Player player in team.Players.Values)
            {
                PirateManager.instance.SpawnPirate(player, boat);
            }
        }

        BoatManager.SendBoatsToPlayers();
        PirateManager.instance.SendPirates();

        using (Packet packet = new Packet((int)ServerPackets.gameStart))
        {
            ServerSend.SendTCPDataToAll(packet);
        }
    }
Example #14
0
 public Boat[] GetBoatsByCustomerId(int id)
 {
     return(BoatManager.GetBoatsByCustomerId(id).ToArray());
 }
Example #15
0
 private void Start()
 {
     _manager = GetComponent<BoatManager>();
     ApplyCannonsAngle();
 }
Example #16
0
 void Awake()
 {
     Body        = GetComponent <Rigidbody>();
     BoatManager = GetComponent <BoatManager>();
 }
Example #17
0
 // Start is called before the first frame update
 void Start()
 {
     GetBoatManager = this;
 }
Example #18
0
 public SpawnedPlayer(GameObject boat, RoomPlayerInfo info)
 {
     Boat = boat;
     Manager = boat.GetComponent<BoatManager>();
     Positioning = new PositioningData(Boat.transform.position, Boat.transform.eulerAngles);
     ShootBuffer = new ShootingData();
     HitBuffer = new List<HealthData>();
     Info = info;
     Updated = true;
 }
 public frmBoatAddEdit(Boat boat, BoatManager boatManager)
 {
     InitializeComponent();
     _boatManager = boatManager;
     _boat        = boat;
 }
Example #20
0
 public string UpdateBoat(int ID, string RegistrationNumber, string Manufacturer, int ModelYear, int Length)
 {
     return(BoatManager.UpdateBoat(ID, RegistrationNumber, Manufacturer, ModelYear, Length));
 }
Example #21
0
 public string AddBoat(string registerNumber, string manufacturer, int modelYear, int length, int customerID)
 {
     return(BoatManager.AddBoat(registerNumber, manufacturer, modelYear, length, customerID));
 }
    // Use this for initialization
    void Start()
    {
        m_Words = GetComponentsInChildren<Renderer> ();

        m_BoatManager = BoatManager.Instance;
    }
Example #23
0
 public Boat[] GetAllBoats()
 {
     return(BoatManager.GetAllBoats().ToArray());
 }
Example #24
0
 private void Start()
 {
     _boatManager = GameObject.FindGameObjectWithTag("Boat").GetComponent <BoatManager>();
     _isLeftOar   = _boatManager.isLeftOar();
 }
Example #25
0
 public Boat GetBoatById(int id)
 {
     return(BoatManager.GetBoatById(id));
 }